fix: Correctly restore unsynced windows, b=no-bug, c=workspaces

This commit is contained in:
mr. m
2026-01-05 19:29:22 +01:00
parent 2628ba7dd8
commit 591193b748
3 changed files with 17 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..41bddb36fef7bb74212c261f1c07e40b30ab5f08 100644
index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..429a26849cec23836f5bff3bd1a6376050311377 100644
--- a/browser/components/sessionstore/SessionStore.sys.mjs
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -127,6 +127,9 @@ const TAB_EVENTS = [
@@ -211,17 +211,20 @@ index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..41bddb36fef7bb74212c261f1c07e40b
tabbrowser.removeTab(tabbrowser.tabs[i]);
}
}
@@ -5821,6 +5851,9 @@ var SessionStoreInternal = {
@@ -5821,6 +5851,12 @@ var SessionStoreInternal = {
savedTabGroup => !openTabGroupIdsInWindow.has(savedTabGroup.id)
);
}
+ if (winData.isZenUnsynced) {
+ aWindow.document.documentElement.setAttribute("zen-unsynced-window", "true");
+ }
+ aWindow.gZenFolders?.restoreDataFromSessionStore(winData.folders);
+ aWindow.gZenViewSplitter?.restoreDataFromSessionStore(winData.splitViewData);
+ aWindow.gZenWorkspaces?.restoreWorkspacesFromSessionStore(winData);
// Move the originally open tabs to the end.
if (initialTabs) {
@@ -6372,6 +6405,25 @@ var SessionStoreInternal = {
@@ -6372,6 +6408,25 @@ var SessionStoreInternal = {
// Most of tabData has been restored, now continue with restoring
// attributes that may trigger external events.
@@ -247,7 +250,7 @@ index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..41bddb36fef7bb74212c261f1c07e40b
if (tabData.pinned) {
tabbrowser.pinTab(tab);
@@ -7290,7 +7342,7 @@ var SessionStoreInternal = {
@@ -7290,7 +7345,7 @@ var SessionStoreInternal = {
let groupsToSave = new Map();
for (let tIndex = 0; tIndex < window.tabs.length; ) {
@@ -256,7 +259,7 @@ index 2c2f43bf743ef458b378e85e9ed44a971711e1d9..41bddb36fef7bb74212c261f1c07e40b
// Adjust window.selected
if (tIndex + 1 < window.selected) {
window.selected -= 1;
@@ -7305,7 +7357,7 @@ var SessionStoreInternal = {
@@ -7305,7 +7360,7 @@ var SessionStoreInternal = {
);
// We don't want to increment tIndex here.
continue;