mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-09 23:03:35 +00:00
fix: Correctly restore unsynced windows, b=no-bug, c=workspaces
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -118,6 +118,11 @@ class nsZenWorkspaces {
|
||||
|
||||
window.addEventListener('resize', this.onWindowResize.bind(this));
|
||||
this.addPopupListeners();
|
||||
|
||||
if (this.privateWindowOrDisabled) {
|
||||
await this.#waitForPromises();
|
||||
await this.restoreWorkspacesFromSessionStore({});
|
||||
}
|
||||
}
|
||||
|
||||
log(...args) {
|
||||
@@ -133,9 +138,6 @@ class nsZenWorkspaces {
|
||||
});
|
||||
};
|
||||
this._pinnedTabsResizeObserver = new ResizeObserver(onResize);
|
||||
if (this.privateWindowOrDisabled) {
|
||||
await this.restoreWorkspacesFromSessionStore({});
|
||||
}
|
||||
this.registerPinnedResizeObserver();
|
||||
this.#initializeWorkspaceTabContextMenus();
|
||||
|
||||
|
||||
@@ -188,6 +188,10 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
:root[zen-unsynced-window='true'][zen-sidebar-expanded='true'] & {
|
||||
padding: calc(-2px + var(--tab-inline-padding) + var(--zen-toolbox-padding));
|
||||
}
|
||||
|
||||
:root:not([zen-unsynced-window]) & {
|
||||
&:hover,
|
||||
&[open='true'] {
|
||||
@@ -243,7 +247,6 @@
|
||||
padding: 4px 8px;
|
||||
border-radius: 99px;
|
||||
font-size: 10px;
|
||||
margin-inline-start: -6px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user