mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-29 03:41:51 +00:00
fix: Make sure to not run any switching when quitting, b=no-bug, c=workspaces
This commit is contained in:
@@ -41,14 +41,13 @@
|
||||
<script type="text/javascript" src="chrome://browser/content/ZenPreloadedScripts.js"></script>
|
||||
|
||||
# Scripts used all over the browser
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenFolder.mjs"></script>
|
||||
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenMediaController.mjs"></script>
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenWorkspaceCreation.mjs"></script>
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenGlanceManager.mjs"></script>
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenPinnedTabManager.mjs"></script>
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenViewSplitter.mjs"></script>
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenFolders.mjs"></script>
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenFolder.mjs"></script>
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenFolders.mjs"></script>s
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenDownloadAnimation.mjs"></script>
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenEmojiPicker.mjs"></script>
|
||||
<script type="module" src="chrome://browser/content/zen-components/ZenLiveFoldersUI.mjs"></script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index d7765e0adb37216d35f2125abf96025cbb150bab..4913c2e6cfb4f77bd8f2c0f33310c27475172132 100644
|
||||
index d7765e0adb37216d35f2125abf96025cbb150bab..d787c39f68ea4507b2cb902df325498dd65b1fba 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -405,6 +405,7 @@
|
||||
@@ -411,9 +411,12 @@ index d7765e0adb37216d35f2125abf96025cbb150bab..4913c2e6cfb4f77bd8f2c0f33310c274
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4122,7 +4247,7 @@
|
||||
@@ -4120,9 +4245,9 @@
|
||||
}
|
||||
|
||||
// Add a new tab if needed.
|
||||
if (!tab) {
|
||||
- if (!tab) {
|
||||
+ if (!tab || tab?._markedForReplacement) {
|
||||
let createLazyBrowser =
|
||||
- restoreTabsLazily && !select && !tabData.pinned;
|
||||
+ restoreTabsLazily && !(tabData.pinned && !Services.prefs.getBoolPref("browser.sessionstore.restore_pinned_tabs_on_demand"));
|
||||
@@ -470,10 +473,10 @@ index d7765e0adb37216d35f2125abf96025cbb150bab..4913c2e6cfb4f77bd8f2c0f33310c274
|
||||
+ gZenWorkspaces._initialTab._shouldRemove = true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
+ else {
|
||||
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
|
||||
}
|
||||
+ }
|
||||
+ this._hasAlreadyInitializedZenSessionStore = true;
|
||||
|
||||
if (tabs.length > 1 || !tabs[0].selected) {
|
||||
|
||||
@@ -16,6 +16,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||
TabStateCache: "resource:///modules/sessionstore/TabStateCache.sys.mjs",
|
||||
setTimeout: "resource://gre/modules/Timer.sys.mjs",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
|
||||
RunState: "resource:///modules/sessionstore/RunState.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(lazy, "gWindowSyncEnabled", "zen.window-sync.enabled", true);
|
||||
@@ -1268,7 +1269,8 @@ class nsZenWindowSync {
|
||||
!window?.gBrowser ||
|
||||
this.#lastFocusedWindow?.deref() === window ||
|
||||
window.closing ||
|
||||
!window.toolbar.visible
|
||||
!window.toolbar.visible ||
|
||||
lazy.RunState.isQuitting
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -450,16 +450,13 @@ class nsZenWorkspaces {
|
||||
workspaceWrapper.hidden = true; // Hide workspace while creating it
|
||||
}
|
||||
container.appendChild(workspaceWrapper);
|
||||
this.#organizeTabsToWorkspaceSections(
|
||||
workspace,
|
||||
workspaceWrapper.tabsContainer,
|
||||
workspaceWrapper.pinnedTabsContainer,
|
||||
tabs
|
||||
);
|
||||
this.#organizeTabsToWorkspaceSections(workspace, workspaceWrapper, tabs);
|
||||
workspaceWrapper.checkPinsExistence();
|
||||
}
|
||||
|
||||
#organizeTabsToWorkspaceSections(workspace, section, pinnedSection, tabs) {
|
||||
#organizeTabsToWorkspaceSections(workspace, spaceElement, tabs) {
|
||||
let section = spaceElement.tabsContainer;
|
||||
let pinnedSection = spaceElement.pinnedTabsContainer;
|
||||
const workspaceTabs = Array.from(tabs).filter(
|
||||
(tab) =>
|
||||
tab.getAttribute("zen-workspace-id") === workspace.uuid &&
|
||||
@@ -1062,6 +1059,7 @@ class nsZenWorkspaces {
|
||||
}
|
||||
// note: We cant access `gZenVerticalTabsManager._canReplaceNewTab` this early
|
||||
if (isEmpty && Services.prefs.getBoolPref("zen.urlbar.replace-newtab", true)) {
|
||||
tab._markedForReplacement = true;
|
||||
this._tabToRemoveForEmpty = tab;
|
||||
} else {
|
||||
this._initialTab = tab;
|
||||
|
||||
Reference in New Issue
Block a user