Skip to content

Commit a710d59

Browse files
committed
fix: FIxed restoring pined and essential tabs not being on the correct parent element, b=(bug #8726), c=tests, workspaces
1 parent 4abb3d2 commit a710d59

File tree

5 files changed

+153
-49
lines changed

5 files changed

+153
-49
lines changed

src/browser/components/sessionstore/SessionStore-sys-mjs.patch

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
2-
index 8c6047e1ada5a22e57e1e665965237c9e22641d7..8d0585e738a5a758ebbddfa0787c71d634dadd4d 100644
2+
index 8c6047e1ada5a22e57e1e665965237c9e22641d7..16b171c56081759e81d3efa6c0c7840fbd7902ff 100644
33
--- a/browser/components/sessionstore/SessionStore.sys.mjs
44
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
55
@@ -2088,7 +2088,6 @@ var SessionStoreInternal = {
@@ -43,7 +43,15 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..8d0585e738a5a758ebbddfa0787c71d6
4343

4444
if (inBackground === false) {
4545
aWindow.gBrowser.selectedTab = newTab;
46-
@@ -5239,7 +5241,7 @@ var SessionStoreInternal = {
46+
@@ -4361,6 +4363,7 @@ var SessionStoreInternal = {
47+
// Append the tab if we're opening into a different window,
48+
index: aSource == aTargetWindow ? pos : Infinity,
49+
pinned: state.pinned,
50+
+ essential: state.zenEssential,
51+
userContextId: state.userContextId,
52+
skipLoad: true,
53+
preferredRemoteType,
54+
@@ -5239,7 +5242,7 @@ var SessionStoreInternal = {
4755
}
4856

4957
let workspaceID = aWindow.getWorkspaceID();
@@ -52,7 +60,7 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..8d0585e738a5a758ebbddfa0787c71d6
5260
winData.workspaceID = workspaceID;
5361
}
5462
},
55-
@@ -5430,14 +5432,15 @@ var SessionStoreInternal = {
63+
@@ -5430,14 +5433,15 @@ var SessionStoreInternal = {
5664
}
5765

5866
let tabbrowser = aWindow.gBrowser;
@@ -70,7 +78,7 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..8d0585e738a5a758ebbddfa0787c71d6
7078
continue;
7179
}
7280
let tabData = lazy.TabState.collect(tab, TAB_CUSTOM_VALUES.get(tab));
73-
@@ -5456,8 +5459,8 @@ var SessionStoreInternal = {
81+
@@ -5456,8 +5460,8 @@ var SessionStoreInternal = {
7482
// We don't store the Firefox View tab in Session Store, so if it was the last selected "tab" when
7583
// a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab,
7684
// since it's only inserted into the tab strip after it's selected).
@@ -81,7 +89,7 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..8d0585e738a5a758ebbddfa0787c71d6
8189
winData.title = tabbrowser.tabs[0].label;
8290
}
8391
winData.selected = selectedIndex;
84-
@@ -5569,8 +5572,8 @@ var SessionStoreInternal = {
92+
@@ -5569,8 +5573,8 @@ var SessionStoreInternal = {
8593
// selectTab represents.
8694
let selectTab = 0;
8795
if (overwriteTabs) {
@@ -92,15 +100,15 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..8d0585e738a5a758ebbddfa0787c71d6
92100
selectTab = Math.min(selectTab, winData.tabs.length);
93101
}
94102

95-
@@ -5613,6 +5616,7 @@ var SessionStoreInternal = {
103+
@@ -5613,6 +5617,7 @@ var SessionStoreInternal = {
96104
winData.tabs,
97105
winData.groups ?? []
98106
);
99107
+ aWindow.gZenViewSplitter?.restoreDataFromSessionStore(winData.splitViewData);
100108
this._log.debug(
101109
`restoreWindow, createTabsForSessionRestore returned ${tabs.length} tabs`
102110
);
103-
@@ -6162,6 +6166,22 @@ var SessionStoreInternal = {
111+
@@ -6162,6 +6167,22 @@ var SessionStoreInternal = {
104112

105113
// Most of tabData has been restored, now continue with restoring
106114
// attributes that may trigger external events.

0 commit comments

Comments
 (0)