diff --git a/src/zen/common/modules/ZenStartup.mjs b/src/zen/common/modules/ZenStartup.mjs index 1de5d9027..db45653bd 100644 --- a/src/zen/common/modules/ZenStartup.mjs +++ b/src/zen/common/modules/ZenStartup.mjs @@ -19,6 +19,13 @@ class ZenStartup { this.#zenInitBrowserLayout(); } + get #shouldUseWatermark() { + return ( + Services.prefs.getBoolPref("zen.watermark.enabled", false) && + gZenWorkspaces.shouldHaveWorkspaces + ); + } + #initBrowserBackground() { const background = document.createXULElement("box"); background.id = "zen-browser-background"; @@ -102,7 +109,7 @@ class ZenStartup { } openWatermark() { - if (!Services.prefs.getBoolPref("zen.watermark.enabled", false)) { + if (!this.#shouldUseWatermark) { document.documentElement.removeAttribute("zen-before-loaded"); return; } @@ -113,7 +120,7 @@ class ZenStartup { closeWatermark() { document.documentElement.removeAttribute("zen-before-loaded"); - if (Services.prefs.getBoolPref("zen.watermark.enabled", false)) { + if (this.#shouldUseWatermark) { let elementsToIgnore = this.#watermarkIgnoreElements.map((id) => "#" + id).join(", "); gZenUIManager.motion .animate( diff --git a/src/zen/sessionstore/ZenWindowSync.sys.mjs b/src/zen/sessionstore/ZenWindowSync.sys.mjs index 38130661b..f22d96505 100644 --- a/src/zen/sessionstore/ZenWindowSync.sys.mjs +++ b/src/zen/sessionstore/ZenWindowSync.sys.mjs @@ -218,7 +218,8 @@ class nsZenWindowSync { if ( !forcedSync && (hasUnsyncedArg || - (typeof aWindow.arguments[0] === "string" && + !aWindow.gZenWorkspaces.shouldHaveWorkspaces || + (typeof aWindow.arguments?.[0] === "string" && aWindow.arguments.length > 1 && !!this.#browserWindowsList.length)) ) { diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 69a2d2ea9..60db687f9 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -778,7 +778,6 @@ class nsZenWorkspaces { this._shouldHaveWorkspaces = chromeFlags & Ci.nsIWebBrowserChrome.CHROME_TOOLBAR || chromeFlags & Ci.nsIWebBrowserChrome.CHROME_MENUBAR; - return this._shouldHaveWorkspaces; } return this._shouldHaveWorkspaces && !document.documentElement.hasAttribute("taskbartab"); }