fix: Fixed restoring previous tab on other workspaces, b=(no-bug), c=compact-mode, workspaces

This commit is contained in:
mr. m
2025-05-07 15:34:17 +02:00
parent 7f4effe4b6
commit be1d8ec408
4 changed files with 22 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
index 5633e5032f5d50c70512187d27e045b579978927..6b9e56cb62a4812925ff812763ea9b0e6a478202 100644
index 5633e5032f5d50c70512187d27e045b579978927..01df61b55b427212a61e6bc2de8c1df612055e1b 100644
--- a/browser/components/sessionstore/SessionStore.sys.mjs
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -2081,7 +2081,6 @@ var SessionStoreInternal = {
@@ -68,7 +68,7 @@ index 5633e5032f5d50c70512187d27e045b579978927..6b9e56cb62a4812925ff812763ea9b0e
continue;
}
let tabData = lazy.TabState.collect(tab, TAB_CUSTOM_VALUES.get(tab));
@@ -5442,7 +5443,7 @@ var SessionStoreInternal = {
@@ -5442,10 +5443,13 @@ var SessionStoreInternal = {
// We don't store the Firefox View tab in Session Store, so if it was the last selected "tab" when
// a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab,
// since it's only inserted into the tab strip after it's selected).
@@ -77,7 +77,13 @@ index 5633e5032f5d50c70512187d27e045b579978927..6b9e56cb62a4812925ff812763ea9b0e
selectedIndex = 1;
winData.title = tabbrowser.tabs[0].label;
}
@@ -5599,6 +5600,7 @@ var SessionStoreInternal = {
+ if (!tabbrowser.selectedTab.pinned) {
+ selectedIndex += 1;
+ }
winData.selected = selectedIndex;
this._updateWindowFeatures(aWindow);
@@ -5599,6 +5603,7 @@ var SessionStoreInternal = {
winData.tabs,
winData.groups ?? []
);
@@ -85,7 +91,7 @@ index 5633e5032f5d50c70512187d27e045b579978927..6b9e56cb62a4812925ff812763ea9b0e
this._log.debug(
`restoreWindow, createTabsForSessionRestore returned ${tabs.length} tabs`
);
@@ -6148,8 +6150,23 @@ var SessionStoreInternal = {
@@ -6148,8 +6153,23 @@ var SessionStoreInternal = {
// Most of tabData has been restored, now continue with restoring
// attributes that may trigger external events.