commit c198264d6626ccba80187461ee755149186c55fb
parent a09a6e8f57ebfca6186aed118f48bb9ede68898f
Author: Greg Stoll <gstoll@mozilla.com>
Date: Wed, 8 Oct 2025 23:42:11 +0000
Bug 1812489 - open a new window if restored windows are on different virtual desktops r=win-reviewers,sessionstore-reviewers,handyman,sfoster
If a user launches Firefox and all restored windows are on a different
virtual desktop, it looks like nothing happened. Ideally we would switch
to one of those desktops, but there's no documented way to do that and
we couldn't figure out how to make it happen in a robust way. Instead,
at least pop open a new window on this virtual desktop so it's clear that
Firefox is running.
Differential Revision: https://phabricator.services.mozilla.com/D267865
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -7443,6 +7443,16 @@ var SessionStoreInternal = {
Services.obs.notifyObservers(null, NOTIFY_BROWSER_STATE_RESTORED);
}
+ // If all windows are on other virtual desktops (on Windows), open a new
+ // window on this desktop so the user isn't left wondering where their
+ // session went. See bug 1812489.
+ let anyWindowNotCloaked = this._browserWindows[Symbol.iterator]().some(
+ window => !window.isCloaked
+ );
+ if (!anyWindowNotCloaked) {
+ lazy.BrowserWindowTracker.openWindow();
+ }
+
this._browserSetState = false;
this._restoreCount = -1;
},