diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index 2c530b8df..a5ca41b3f 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -368,9 +368,10 @@ #zen-browser-tabs-wrapper { min-height: fit-content; overflow-y: auto; - overflow-x: clip; + overflow-x: clip !important; /* might break custom css with new design, so let's force it */ height: 100%; scrollbar-width: thin; + position: relative; } #vertical-pinned-tabs-container { @@ -378,7 +379,8 @@ display: flex !important; flex-direction: column; min-height: fit-content !important; - overflow: visible; + overflow-x: clip; + overflow-y: visible; max-height: unset !important; & .tabbrowser-tab:not(:hover) .tab-background:not([selected]):not([multiselected]) { diff --git a/src/browser/base/zen-components/ZenWorkspaces.mjs b/src/browser/base/zen-components/ZenWorkspaces.mjs index 2fa911df9..9aeeeabb7 100644 --- a/src/browser/base/zen-components/ZenWorkspaces.mjs +++ b/src/browser/base/zen-components/ZenWorkspaces.mjs @@ -1308,7 +1308,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { } tab.setAttribute('zen-workspace-id', workspaceID); const parent = tab.pinned ? '#zen-browser-tabs-pinned ' : '#zen-browser-tabs '; - const container = document.querySelector(parent + '.zen-browser-tabs-container'); + const container = document.querySelector(parent + '.zen-workspace-tabs-section'); if (container) { container.insertBefore(tab, container.firstChild); } @@ -2036,4 +2036,43 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { // Return true only if the bookmark is in another workspace and not in the active one return isInOtherWorkspace && !isInActiveWorkspace; } + + // Session restore functions + get allStoredTabs() { + if (!this._hasInitializedTabsStrip) { + const children = Array.from(this.tabboxChildren); + children.pop(); // Remove the last child which is the new tab button + return children; + } + + const tabs = []; + // we need to go through each tab in each container + const essentialsContainer = document.getElementById('zen-essentials-container'); + const pinnedContainers = document.querySelectorAll('#vertical-pinned-tabs-container .zen-workspace-tabs-section'); + const normalContainers = document.querySelectorAll('#tabbrowser-arrowscrollbox .zen-workspace-tabs-section'); + const containers = [essentialsContainer, ...pinnedContainers, ...normalContainers]; + for (const container of containers) { + for (const tab of container.children) { + if (tab.tagName === 'tab' || tab.tagName == 'tab-group') { + tabs.push(tab); + } + } + } + return tabs; + } + + get pinnedTabCount() { + return this.pinnedTabsContainer.children.length - 1; + } + + get normalTabCount() { + return this.tabboxChildren.length - 1; + } + + get allWorkspaceTabs() { + const currentWorkspace = this.activeWorkspace; + return this.allStoredTabs.filter( + (tab) => tab.hasAttribute('zen-essential') || tab.getAttribute('zen-workspace-id') === currentWorkspace + ); + } })(); diff --git a/src/browser/components/sessionstore/SessionStore-sys-mjs.patch b/src/browser/components/sessionstore/SessionStore-sys-mjs.patch index 85c7071f7..2c7b2688f 100644 --- a/src/browser/components/sessionstore/SessionStore-sys-mjs.patch +++ b/src/browser/components/sessionstore/SessionStore-sys-mjs.patch @@ -1,8 +1,8 @@ diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs -index 8125c1afc07f3365a2ad030adaf6a560453d7fe6..2856c5f93bfc9d68b98e09b2f26e3d5266c1f46a 100644 +index 908743177d9f95e2e6549c689e7a493ca8668701..b452d7dfc93f6171f8a65668e052a37638f1f6c3 100644 --- a/browser/components/sessionstore/SessionStore.sys.mjs +++ b/browser/components/sessionstore/SessionStore.sys.mjs -@@ -3679,6 +3679,7 @@ var SessionStoreInternal = { +@@ -3848,6 +3848,7 @@ var SessionStoreInternal = { aWindow.gBrowser.selectedTab = newTab; } @@ -10,3 +10,12 @@ index 8125c1afc07f3365a2ad030adaf6a560453d7fe6..2856c5f93bfc9d68b98e09b2f26e3d52 // Restore the state into the new tab. this.restoreTab(newTab, tabState, { restoreImmediately: aRestoreImmediately, +@@ -5315,7 +5316,7 @@ var SessionStoreInternal = { + } + + let tabbrowser = aWindow.gBrowser; +- let tabs = tabbrowser.tabs; ++ let tabs = aWindow.ZenWorkspaces.allStoredTabs; + /** @type {WindowStateData} */ + let winData = this._windows[aWindow.__SSi]; + let tabsData = (winData.tabs = []); diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index 1e2d0b8fc..e5ba04639 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 ff90a70bdad6c94ec4b90027ff102972d0eb28e5..cbeb4472fdc7dc12c2a45a0c578d166c1cac1b6b 100644 +index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..c90119b4b248887fd8612beb9aac83c6eeb57088 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js @@ -406,11 +406,39 @@ @@ -57,12 +57,8 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..cbeb4472fdc7dc12c2a45a0c578d166c } aTab.setAttribute("pinned", "true"); this._updateTabBarForPinnedTabs(); -@@ -828,10 +856,10 @@ - // the moving of a tab from the vertical pinned tabs container - // and back into arrowscrollbox. - aTab.removeAttribute("pinned"); -- this.tabContainer.arrowScrollbox.prepend(aTab); -+ ZenWorkspaces.activeWorkspaceStrip.prepend(aTab); +@@ -831,7 +859,7 @@ + this.tabContainer.arrowScrollbox.prepend(aTab); }); } else { - this.moveTabTo(aTab, this.pinnedTabCount - 1, { diff --git a/src/browser/components/tabbrowser/content/tabs-js.patch b/src/browser/components/tabbrowser/content/tabs-js.patch index 149134733..dfafb0b6c 100644 --- a/src/browser/components/tabbrowser/content/tabs-js.patch +++ b/src/browser/components/tabbrowser/content/tabs-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js -index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67709dae7d 100644 +index 8aeb244ffca9f48661805f5b7d860b5896055562..f7866af6f5b72e2704a87148300a391b20e112db 100644 --- a/browser/components/tabbrowser/content/tabs.js +++ b/browser/components/tabbrowser/content/tabs.js @@ -94,7 +94,7 @@ @@ -209,7 +209,12 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 if (tab && rect(tab).width <= this._tabClipWidth) { this.setAttribute("closebuttons", "activetab"); } else { -@@ -1832,6 +1858,7 @@ +@@ -1828,10 +1854,12 @@ + + _handleTabSelect(aInstant) { + let selectedTab = this.selectedItem; ++ if (!selectedTab) return; + if (this.overflowing) { this.arrowScrollbox.ensureElementIsVisible(selectedTab, aInstant); } @@ -217,7 +222,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 selectedTab._notselectedsinceload = false; } -@@ -1843,7 +1870,7 @@ +@@ -1843,7 +1871,7 @@ return; } @@ -226,7 +231,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 if (!tabs.length) { return; } -@@ -1879,7 +1906,7 @@ +@@ -1879,7 +1907,7 @@ if (isEndTab && !this._hasTabTempMaxWidth) { return; } @@ -235,7 +240,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 // Force tabs to stay the same width, unless we're closing the last tab, // which case we need to let them expand just enough so that the overall // tabbar width is the same. -@@ -1894,7 +1921,7 @@ +@@ -1894,7 +1922,7 @@ let tabsToReset = []; for (let i = numPinned; i < tabs.length; i++) { let tab = tabs[i]; @@ -244,7 +249,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 if (!isEndTab) { // keep tabs the same width tab.style.transition = "none"; -@@ -1960,16 +1987,15 @@ +@@ -1960,16 +1988,15 @@ // Move pinned tabs to another container when the tabstrip is toggled to vertical // and when session restore code calls _positionPinnedTabs; update styling whenever // the number of pinned tabs changes. @@ -266,7 +271,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 } } -@@ -1977,9 +2003,7 @@ +@@ -1977,9 +2004,7 @@ } _resetVerticalPinnedTabs() { @@ -277,7 +282,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 if (!verticalTabsContainer.children.length) { return; -@@ -1992,8 +2016,8 @@ +@@ -1992,8 +2017,8 @@ } _positionPinnedTabs() { @@ -288,7 +293,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 let absPositionHorizontalTabs = this.overflowing && tabs.length > numPinned && numPinned > 0; -@@ -2074,7 +2098,7 @@ +@@ -2074,7 +2099,7 @@ return; } @@ -297,7 +302,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 let directionX = screenX > dragData.animLastScreenX; let directionY = screenY > dragData.animLastScreenY; -@@ -2257,9 +2281,9 @@ +@@ -2257,9 +2282,9 @@ } let pinned = draggedTab.pinned; @@ -310,7 +315,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 pinned ? numPinned : undefined ); -@@ -2502,8 +2526,9 @@ +@@ -2502,8 +2527,9 @@ ); } @@ -322,7 +327,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 return; } -@@ -2668,9 +2693,9 @@ +@@ -2668,9 +2694,9 @@ function newIndex(aTab, index) { // Don't allow mixing pinned and unpinned tabs. if (aTab.pinned) { @@ -334,7 +339,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 } } -@@ -2754,7 +2779,7 @@ +@@ -2754,7 +2780,7 @@ } _notifyBackgroundTab(aTab) { @@ -343,7 +348,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 return; } -@@ -2772,12 +2797,14 @@ +@@ -2772,12 +2798,14 @@ selectedTab = { left: selectedTab.left, right: selectedTab.right, @@ -359,7 +364,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 selectedTab, ]; }) -@@ -2794,8 +2821,11 @@ +@@ -2794,8 +2822,11 @@ delete this._lastTabToScrollIntoView; // Is the new tab already completely visible? if ( @@ -373,7 +378,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..ab0a6a6ed80608385b4663775b4edf67 ) { return; } -@@ -2803,21 +2833,29 @@ +@@ -2803,21 +2834,29 @@ if (this.arrowScrollbox.smoothScroll) { // Can we make both the new tab and the selected tab completely visible? if ( diff --git a/src/modules/libpref/init/StaticPrefList-yaml.patch b/src/modules/libpref/init/StaticPrefList-yaml.patch index 6d3166133..fadcff2b1 100644 --- a/src/modules/libpref/init/StaticPrefList-yaml.patch +++ b/src/modules/libpref/init/StaticPrefList-yaml.patch @@ -1,8 +1,8 @@ diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml -index 5c5992d7b32e4c16d6a92815ca6fd54e8fcec824..6c8e67e36f02b578c800fa460868135afb73c66b 100644 +index 7364514f74703184462e8dbce3f0aafc3f850a3d..560671beddf6c216e918a47bd5dbd4e770a24ec7 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml -@@ -17810,7 +17810,7 @@ +@@ -18067,7 +18067,7 @@ # Whether we use the mica backdrop. Off by default for now. - name: widget.windows.mica type: bool @@ -11,7 +11,7 @@ index 5c5992d7b32e4c16d6a92815ca6fd54e8fcec824..6c8e67e36f02b578c800fa460868135a mirror: once #endif -@@ -17923,6 +17923,19 @@ +@@ -18180,6 +18180,26 @@ mirror: always #endif @@ -27,6 +27,13 @@ index 5c5992d7b32e4c16d6a92815ca6fd54e8fcec824..6c8e67e36f02b578c800fa460868135a + value: false + mirror: always +#endif ++ ++#ifdef XP_WIN ++- name: zen.widget.windows.acrylic ++ type: bool ++ value: true ++ mirror: once ++#endif + #--------------------------------------------------------------------------- # Prefs starting with "zoom." diff --git a/src/widget/windows/nsWindow-cpp.patch b/src/widget/windows/nsWindow-cpp.patch new file mode 100644 index 000000000..99fe82efa --- /dev/null +++ b/src/widget/windows/nsWindow-cpp.patch @@ -0,0 +1,21 @@ +diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp +index b735e78b1c2f3e0d85a5224311cdc746007c7eac..50f3c6e40b11220b71a8a3811305661887bb4360 100644 +--- a/widget/windows/nsWindow.cpp ++++ b/widget/windows/nsWindow.cpp +@@ -165,6 +165,7 @@ + #include "mozilla/StaticPrefs_layout.h" + #include "mozilla/StaticPrefs_ui.h" + #include "mozilla/StaticPrefs_widget.h" ++#include "mozilla/StaticPrefs_zen.h" + #include "nsNativeAppSupportWin.h" + + #include "nsIGfxInfo.h" +@@ -1071,7 +1072,7 @@ nsresult nsWindow::Create(nsIWidget* aParent, const LayoutDeviceIntRect& aRect, + + if (WinUtils::MicaEnabled() && !IsPopup()) { + // Enable Mica Alt Material if available. +- const DWM_SYSTEMBACKDROP_TYPE tabbedWindow = DWMSBT_TABBEDWINDOW; ++ const DWM_SYSTEMBACKDROP_TYPE tabbedWindow = StaticPrefs::zen_widget_windows_acrylic_AtStartup() ? DWMSBT_TRANSIENTWINDOW : DWMSBT_TABBEDWINDOW; + DwmSetWindowAttribute(mWnd, DWMWA_SYSTEMBACKDROP_TYPE, &tabbedWindow, + sizeof tabbedWindow); + } diff --git a/surfer.json b/surfer.json index 96ac3b992..8b97e5388 100644 --- a/surfer.json +++ b/surfer.json @@ -53,4 +53,4 @@ "licenseType": "MPL-2.0" }, "updateHostname": "updates.zen-browser.app" -} +} \ No newline at end of file