Fixed workspace switching

This commit is contained in:
mr. m
2025-02-13 11:16:16 +01:00
parent 22cc24e9f8
commit ab836eb762
2 changed files with 6 additions and 4 deletions

View File

@@ -37,7 +37,6 @@
this.initCanvas();
this.initCustomColorInput();
ZenWorkspaces.addChangeListeners(this.onWorkspaceChange.bind(this));
window.matchMedia('(prefers-color-scheme: dark)').addListener(this.onDarkModeChange.bind(this));
}

View File

@@ -1627,7 +1627,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
return tabToSelect;
}
async _updateWorkspaceState(window, onInit) {
async _updateWorkspaceState(window, onInit, tabToSelect) {
// Update document state
document.documentElement.setAttribute('zen-workspace-id', window.uuid);
@@ -1639,6 +1639,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
gZenUIManager.updateTabsToolbar();
await this._propagateWorkspaceData({ clearCache: false });
gZenThemePicker.onWorkspaceChange(window);
await this._animateTabs(window, !onInit && !this._animatingChange);
gBrowser.selectedTab = tabToSelect;
// Notify listeners
if (this._changeListeners?.length) {
for (const listener of this._changeListeners) {
@@ -1646,8 +1651,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
}
await this._animateTabs(window, !onInit && !this._animatingChange);
// Reset bookmarks
this._invalidateBookmarkContainers();