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.
This commit is contained in:
Moonchild 2023-12-29 13:53:16 +01:00 committed by roytam1
commit b47cb0f6a4
2 changed files with 9 additions and 7 deletions

View file

@ -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

View file

@ -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");