From b47cb0f6a4caa2f91cc543a389afab59d24938ec Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 29 Dec 2023 13:53:16 +0100 Subject: [PATCH] Issue #2407 - Rename full-screen-api.ignore-widgets Renames to full-screen-api.restrict-to-window and clarifies comments for its intended use. Resolves #2407. --- dom/base/nsGlobalWindow.cpp | 11 ++++++----- modules/libpref/init/all.js | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 295c498965..f264aa50d5 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -6927,11 +6927,12 @@ nsGlobalWindow::SetFullscreenInternal(FullscreenReason aReason, // gone full screen, the state trap above works. mFullScreen = aFullScreen; - // Sometimes we don't want the top-level widget to actually go fullscreen, - // for example in the B2G desktop client, we don't want the emulated screen - // dimensions to appear to increase when entering fullscreen mode; we just - // want the content to fill the entire client area of the emulator window. - if (!Preferences::GetBool("full-screen-api.ignore-widgets", false)) { + // Sometimes, users don't want the DOM to actually go fullscreen, for + // example on large monitors where it would waste screen real estate. + // When restricted by the relevant preference, we just want the content + // to fill the area of the existing window, instead, which is done by + // skipping resizing of the top-level content widget to be screen-filling. + if (!Preferences::GetBool("full-screen-api.restrict-to-window", false)) { if (MakeWidgetFullscreen(this, aReason, aFullScreen)) { // The rest of code for switching fullscreen is in nsGlobalWindow:: // FinishFullscreenChange() which will be called after sizemodechange diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 3b46c33b27..c1c50c25af 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4564,8 +4564,9 @@ pref("full-screen-api.enabled", false); pref("full-screen-api.unprefix.enabled", true); pref("full-screen-api.allow-trusted-requests-only", true); pref("full-screen-api.pointer-lock.enabled", true); -// whether to prevent the top level widget from going fullscreen -pref("full-screen-api.ignore-widgets", false); +// Whether to restrict the full-screen API to the existing window size +// If true, this effectively make fullscreen "fill window" instead. +pref("full-screen-api.restrict-to-window", false); // transition duration of fade-to-black and fade-from-black, unit: ms pref("full-screen-api.transition-duration.enter", "0 0");