diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js index c650b7df..ebec55bb 100644 --- a/src/browser/app/profile/zen-browser.js +++ b/src/browser/app/profile/zen-browser.js @@ -312,10 +312,9 @@ pref("mousewheel.default.delta_multiplier_y", 200); #endif #if defined(XP_WIN) - pref("dom.ipc.processPriorityManager.backgroundUsesEcoQoS", false); +pref("dom.ipc.processPriorityManager.backgroundUsesEcoQoS", false); #endif -pref('browser.sessionstore.restore_pinned_tabs_on_demand', true); pref('browser.newtabpage.activity-stream.system.showWeather', true); // Enable experimental settings page (Used for Zen Labs) diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index 430346b2..e3d9a370 100644 --- a/src/browser/components/tabbrowser/content/tabbrowser-js.patch +++ b/src/browser/components/tabbrowser/content/tabbrowser-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js -index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e218b527ed 100644 +index 5f406ea5d09273c9b70b84eee24c6267f88692f8..c4fa57b30e48c9364bf252e7f1f62ae9c6fa3b40 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js @@ -424,11 +424,67 @@ @@ -347,15 +347,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (!tabData.pinned) { this.unpinTab(tab); } else { -@@ -3522,6 +3647,7 @@ - restoreTabsLazily && !select && !tabData.pinned; - - let url = "about:blank"; -+ gZenPinnedTabManager.resetPinnedTabData(tabData); - if (tabData.entries?.length) { - let activeIndex = (tabData.index || tabData.entries.length) - 1; - // Ensure the index is in bounds. -@@ -3557,7 +3683,27 @@ +@@ -3557,7 +3682,27 @@ skipLoad: true, preferredRemoteType, }); @@ -384,7 +376,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (select) { tabToSelect = tab; } -@@ -3570,8 +3716,8 @@ +@@ -3570,8 +3715,8 @@ // inserted in the DOM. If the tab is not yet in the DOM, // just insert it in the right place from the start. if (!tab.parentNode) { @@ -395,7 +387,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 tab.toggleAttribute("pinned", true); this.tabContainer._invalidateCachedTabs(); // Then ensure all the tab open/pinning information is sent. -@@ -3581,7 +3727,8 @@ +@@ -3581,7 +3726,8 @@ // needs calling: shouldUpdateForPinnedTabs = true; } @@ -405,7 +397,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 let { groupId } = tabData; const tabGroup = tabGroupWorkingData.get(groupId); // if a tab refers to a tab group we don't know, skip any group -@@ -3595,7 +3742,10 @@ +@@ -3595,7 +3741,10 @@ tabGroup.stateData.id, tabGroup.stateData.color, tabGroup.stateData.collapsed, @@ -417,7 +409,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 ); tabsFragment.appendChild(tabGroup.node); } -@@ -3646,6 +3796,9 @@ +@@ -3646,6 +3795,9 @@ this.selectedTab = tabToSelect; this.removeTab(leftoverTab); } @@ -427,7 +419,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (tabs.length > 1 || !tabs[0].selected) { this._updateTabsAfterInsert(); -@@ -3830,7 +3983,7 @@ +@@ -3830,7 +3982,7 @@ // Ensure we have an index if one was not provided. if (typeof index != "number") { // Move the new tab after another tab if needed, to the end otherwise. @@ -436,7 +428,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if ( !bulkOrderedOpen && ((openerTab && -@@ -3876,18 +4029,18 @@ +@@ -3876,18 +4028,18 @@ // Ensure index is within bounds. if (tab.pinned) { @@ -459,7 +451,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (tabAfter && tabAfter.group == tabGroup) { // Place at the front of, or between tabs in, the same tab group this.tabContainer.insertBefore(tab, tabAfter); -@@ -4199,6 +4352,9 @@ +@@ -4199,6 +4351,9 @@ return; } @@ -469,7 +461,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 this.removeTabs(selectedTabs); } -@@ -4450,6 +4606,7 @@ +@@ -4450,6 +4605,7 @@ skipGroupCheck = false, } = {} ) { @@ -477,7 +469,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 // When 'closeWindowWithLastTab' pref is enabled, closing all tabs // can be considered equivalent to closing the window. if ( -@@ -4556,6 +4713,7 @@ +@@ -4556,6 +4712,7 @@ skipSessionStore, } = {} ) { @@ -485,7 +477,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (UserInteraction.running("browser.tabs.opening", window)) { UserInteraction.finish("browser.tabs.opening", window); } -@@ -4572,6 +4730,12 @@ +@@ -4572,6 +4729,12 @@ TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab); } @@ -498,7 +490,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 // Handle requests for synchronously removing an already // asynchronously closing tab. if (!animate && aTab.closing) { -@@ -4586,7 +4750,9 @@ +@@ -4586,7 +4749,9 @@ // frame created for it (for example, by updating the visually selected // state). let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width; @@ -509,7 +501,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if ( !this._beginRemoveTab(aTab, { closeWindowFastpath: true, -@@ -4600,7 +4766,6 @@ +@@ -4600,7 +4765,6 @@ TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab); return; } @@ -517,7 +509,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 let lockTabSizing = !this.tabContainer.verticalMode && !aTab.pinned && -@@ -4739,14 +4904,14 @@ +@@ -4739,14 +4903,14 @@ !!this.tabsInCollapsedTabGroups.length; if ( aTab.visible && @@ -534,7 +526,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (closeWindow) { // We've already called beforeunload on all the relevant tabs if we get here, -@@ -4770,6 +4935,7 @@ +@@ -4770,6 +4934,7 @@ newTab = true; } @@ -542,7 +534,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 aTab._endRemoveArgs = [closeWindow, newTab]; // swapBrowsersAndCloseOther will take care of closing the window without animation. -@@ -4810,9 +4976,7 @@ +@@ -4810,9 +4975,7 @@ aTab._mouseleave(); if (newTab) { @@ -553,7 +545,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 } else { TabBarVisibility.update(); } -@@ -4941,6 +5105,8 @@ +@@ -4941,6 +5104,8 @@ this.tabs[i]._tPos = i; } @@ -562,7 +554,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (!this._windowIsClosing) { if (wasPinned) { this.tabContainer._positionPinnedTabs(); -@@ -5064,8 +5230,8 @@ +@@ -5064,8 +5229,8 @@ return closedCount; } @@ -573,7 +565,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (unloadBlocked) { return; } -@@ -5159,7 +5325,7 @@ +@@ -5159,7 +5324,7 @@ !excludeTabs.has(aTab.owner) && Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose") ) { @@ -582,7 +574,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 } // Try to find a remaining tab that comes after the given tab -@@ -5181,7 +5347,7 @@ +@@ -5181,7 +5346,7 @@ } if (tab) { @@ -591,7 +583,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 } // If no qualifying visible tab was found, see if there is a tab in -@@ -5599,10 +5765,10 @@ +@@ -5599,10 +5764,10 @@ SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); } @@ -604,7 +596,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 aTab.selected || aTab.closing || // Tabs that are sharing the screen, microphone or camera cannot be hidden. -@@ -5838,7 +6004,7 @@ +@@ -5838,7 +6003,7 @@ moveTabTo(aTab, aIndex, { forceStandaloneTab = false } = {}) { // Don't allow mixing pinned and unpinned tabs. if (aTab.pinned) { @@ -613,7 +605,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 } else { aIndex = Math.max(aIndex, this.pinnedTabCount); } -@@ -5848,10 +6014,17 @@ +@@ -5848,10 +6013,17 @@ this.#handleTabMove(aTab, () => { let neighbor = this.tabs[aIndex]; @@ -633,7 +625,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 neighbor.after(aTab); } else { this.tabContainer.insertBefore(aTab, neighbor); -@@ -5901,13 +6074,22 @@ +@@ -5901,13 +6073,22 @@ * Bug 1955388 - prevent pinned tabs from commingling with non-pinned tabs * when there are hidden tabs present */ @@ -657,7 +649,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (tab.pinned && this.tabContainer.verticalMode) { return this.tabContainer.verticalPinnedTabsContainer; } -@@ -5937,7 +6119,7 @@ +@@ -5937,7 +6118,7 @@ } moveTabToGroup(aTab, aGroup) { @@ -666,7 +658,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 return; } if (aTab.group && aTab.group.id === aGroup.id) { -@@ -5961,6 +6143,10 @@ +@@ -5961,6 +6142,10 @@ moveActionCallback(); @@ -677,7 +669,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 // Clear tabs cache after moving nodes because the order of tabs may have // changed. this.tabContainer._invalidateCachedTabs(); -@@ -6015,7 +6201,7 @@ +@@ -6015,7 +6200,7 @@ createLazyBrowser, }; @@ -686,7 +678,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) { params.pinned = true; } -@@ -6765,7 +6951,7 @@ +@@ -6765,7 +6950,7 @@ // preventDefault(). It will still raise the window if appropriate. break; } @@ -695,7 +687,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 window.focus(); aEvent.preventDefault(); break; -@@ -7671,6 +7857,7 @@ +@@ -7671,6 +7856,7 @@ aWebProgress.isTopLevel ) { this.mTab.setAttribute("busy", "true"); @@ -703,7 +695,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 gBrowser._tabAttrModified(this.mTab, ["busy"]); this.mTab._notselectedsinceload = !this.mTab.selected; } -@@ -8640,7 +8827,7 @@ var TabContextMenu = { +@@ -8640,7 +8826,7 @@ var TabContextMenu = { ); contextUnpinSelectedTabs.hidden = !this.contextTab.pinned || !this.multiselected; @@ -712,7 +704,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 // Move Tab items let contextMoveTabOptions = document.getElementById( "context_moveTabOptions" -@@ -8674,7 +8861,7 @@ var TabContextMenu = { +@@ -8674,7 +8860,7 @@ var TabContextMenu = { let isFirstTab = !this.contextTabs[0].group && (this.contextTabs[0] == visibleTabs[0] || @@ -721,7 +713,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e2 contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent; document.getElementById("context_openTabInWindow").disabled = -@@ -8904,6 +9091,7 @@ var TabContextMenu = { +@@ -8904,6 +9090,7 @@ var TabContextMenu = { if (this.contextTab.multiselected) { gBrowser.removeMultiSelectedTabs(); } else { diff --git a/src/zen/split-view/ZenViewSplitter.mjs b/src/zen/split-view/ZenViewSplitter.mjs index 6841721d..31a28ba3 100644 --- a/src/zen/split-view/ZenViewSplitter.mjs +++ b/src/zen/split-view/ZenViewSplitter.mjs @@ -90,6 +90,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature { this.initializeContextMenu(); this.insertIntoContextMenu(); + window.addEventListener('AfterWorkspacesSessionRestore', this.onAfterWorkspaceSessionRestore.bind(this), { + once: true, + }); + // Add drag over listener to the browser view if (Services.prefs.getBoolPref('zen.splitView.enable-tab-drop')) { const tabBox = document.getElementById('tabbrowser-tabbox'); diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index ec7e67d6..61bb17c1 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -195,7 +195,15 @@ pinsToCreate.delete(pinId); if (lazy.zenPinnedTabRestorePinnedTabsToPinnedUrl && init) { - this._resetTabToStoredState(tab); + tab.addEventListener( + 'SSTabRestored', + () => { + this._resetTabToStoredState(event.target); + }, + { + once: true, + } + ); } } else { // This is a pinned tab that no longer has a corresponding pin diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index 3e514c88..6619edeb 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -1122,7 +1122,7 @@ --zen-essential-bg-margin: 2px; &::before { - background: light-dark(rgba(255, 255, 255, 0.85), rgba(143, 143, 143, 0.65)); + background: light-dark(rgba(255, 255, 255, 0.85), rgba(146, 146, 146, 0.65)); margin: var(--zen-essential-bg-margin); border-radius: calc(var(--border-radius-medium) - var(--zen-essential-bg-margin)); position: absolute; @@ -1135,7 +1135,7 @@ } &[visuallyselected]:hover .tab-background::before { - background: light-dark(rgba(255, 255, 255, 0.80), rgba(121, 121, 121, 0.65)); + background: light-dark(rgba(255, 255, 255, 0.80), rgba(133, 133, 133, 0.65)); } } } diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 06f2ed94..ec4f24ec 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -649,7 +649,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { if (gZenVerticalTabsManager._canReplaceNewTab && showed) { BrowserCommands.openTab(); } - gZenViewSplitter.onAfterWorkspaceSessionRestore(); + window.dispatchEvent(new CustomEvent('AfterWorkspacesSessionRestore', { bubbles: true })); } handleInitialTab(tab, isEmpty) {