firefox/D249071.restoreWinState.diff
Jan Horak b5b002067d Rebase to 140.3.0 ESR
Following changes were made during rebase:
Use gcc toolset 14 instead of 13
Fixed annocheck workaround and backported ensure kiosk mode
Removed disable-vsync-for-kiosk.patch
Update to 140 esr
Update bundled package list
Cleanup patches:
- remove unused patches
- fix patch versioning
- rename webrtc-128.0.patch to D225034.xxxx based on the merge request
Use system libraries for drm/gbm/pipewire
Update patch disabling PipeWire support
Backported fips patches
Enable system nss
Update nss versions
Added fixes for rhel9 from SE
Fix the system pipewire build
Update to 140.1.0
Cleanup and incorporating of SE changes
Fixing spec file
adding av1-else-condition-add.patch
fixing av1 disable patch
Fixed exceptionHandler patch
Update to 140.2.0
Removed bundled(cups) as long as it is not bundled
Changes related to rebase-140 of rhel-9.x(9.0, 9.2, 9.4) streams owned by SE
1.Added updated nss-3.112 in the Sources and .gitignore and updated its reference inside specfile
2.Add condition to not enable system_gbm, drm, pipewire as build was failing
3.Added handling for setting bundled_nss=1 for these streams,so that it used nss bundled nspr
changes related to rhel 8.x(2,4,6,8) and 7.9 version
Added fixes for missing translation and gnome kiosk
Update to 140.3.0 esr

Resolves: RHEL-114008
2025-09-18 14:44:24 +02:00

54 lines
1.8 KiB
Diff

diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -1762,10 +1762,16 @@
- name: browser.privatebrowsing.forceMediaMemoryCache
type: bool
value: false
mirror: always
+# Disable state restoration, allowing the kiosk desktop environment to manage state and position.
+- name: browser.restoreWindowState.disabled
+ type: bool
+ value: false
+ mirror: always
+
# Communicates the toolbar color to platform (for e.g., prefers-color-scheme).
#
# Returns whether the toolbar is dark (0), light (1), or system (2). The
# theming code overrides it if appropriate.
- name: browser.theme.toolbar-theme
diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp
--- a/xpfe/appshell/AppWindow.cpp
+++ b/xpfe/appshell/AppWindow.cpp
@@ -58,10 +58,11 @@
#include "mozilla/AutoRestore.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/Services.h"
#include "mozilla/SpinEventLoopUntil.h"
+#include "mozilla/StaticPrefs_browser.h"
#include "mozilla/dom/BarProps.h"
#include "mozilla/dom/DOMRect.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Event.h"
#include "mozilla/dom/ScriptSettings.h"
@@ -2393,10 +2394,16 @@
nsCOMPtr<dom::Element> docShellElement = GetWindowDOMElement();
if (!docShellElement) {
return;
}
+ // Disable state restoration, allowing the kiosk desktop environment
+ // to manage state and position.
+ if (StaticPrefs::browser_restoreWindowState_disabled()) {
+ return;
+ }
+
// Check if the window wants to persist anything.
nsAutoString persist;
docShellElement->GetAttr(nsGkAtoms::persist, persist);
if (persist.IsEmpty()) {
return;