Skip to content

Commit 9907722

Browse files
committed
chore: Enable Zen Workspaces functionality and set default workspace to "Default Workspace"
1 parent 4b706ff commit 9907722

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

src/browser/app/profile/zen-browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,4 @@ pref('zen.sidebar.floating', true);
153153
pref('zen.splitView.working', false);
154154

155155
// Zen Workspaces
156-
pref('zen.workspaces.enabled', false);
156+
pref('zen.workspaces.enabled', true);

src/browser/base/content/ZenWorkspaces.mjs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
var ZenWorkspaces = {
33
async init() {
4+
let docElement = document.documentElement;
5+
if (docElement.getAttribute("chromehidden").includes("toolbar")
6+
|| docElement.getAttribute("chromehidden").includes("menubar")) {
7+
console.log("!!! ZenWorkspaces is disabled in hidden windows !!!");
8+
return; // We are in a hidden window, don't initialize ZenWorkspaces
9+
}
410
console.log("Initializing ZenWorkspaces...");
511
await this.initializeWorkspaces();
612
console.log("ZenWorkspaces initialized");
@@ -52,11 +58,11 @@ var ZenWorkspaces = {
5258
let workspaces = await this._workspaces();
5359
console.log("Workspaces loaded", workspaces);
5460
if (workspaces.workspaces.length === 0) {
55-
await this.createAndSaveWorkspace("Default Workspace");
61+
await this.createAndSaveWorkspace("Default Workspace", true);
5662
} else {
57-
let activeWorkspace = workspaces.workspaces.find(workspace => workspace.used);
63+
let activeWorkspace = workspaces.workspaces.find(workspace => workspace.default);
5864
if (!activeWorkspace) {
59-
activeWorkspace = workspaces.workspaces.find(workspace => workspace.default);
65+
activeWorkspace = workspaces.workspaces.find(workspace => workspace.used);
6066
activeWorkspace.used = true;
6167
await this.saveWorkspaces();
6268
}
@@ -272,10 +278,10 @@ var ZenWorkspaces = {
272278
await this._propagateWorkspaceData();
273279
},
274280

275-
_createWorkspaceData(name) {
281+
_createWorkspaceData(name, isDefault) {
276282
let window = {
277283
uuid: gZenUIManager.generateUuidv4(),
278-
default: false,
284+
default: isDefault,
279285
used: true,
280286
icon: "",
281287
name: name,
@@ -284,11 +290,11 @@ var ZenWorkspaces = {
284290
return window;
285291
},
286292

287-
async createAndSaveWorkspace(name = "New Workspace") {
293+
async createAndSaveWorkspace(name = "New Workspace", isDefault = false) {
288294
if (!this.workspaceEnabled) {
289295
return;
290296
}
291-
let workspaceData = this._createWorkspaceData(name);
297+
let workspaceData = this._createWorkspaceData(name, isDefault);
292298
await this.saveWorkspace(workspaceData);
293299
await this.changeWorkspace(workspaceData);
294300
},

src/browser/themes/shared/zen-browser-shared.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ panelmultiview {
568568
}
569569

570570
#zen-watermark[hidden="true"] {
571-
transition: 1s;
571+
transition: 0.6s;
572572
transition-delay: 1.5s;
573573
opacity: 0;
574574
pointer-events: none;

0 commit comments

Comments
 (0)