From 0251d917b973c6646be65b08bce729c997fada42 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Sat, 13 Sep 2025 19:56:26 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Revert=20"Enable=20workspace=20horizontal?= =?UTF-8?q?=20scrolling=20compatibility=20for=20Logitech=20mice=E2=80=A6"?= =?UTF-8?q?=20(#10355)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/zen/workspaces/ZenWorkspaces.mjs | 59 ++++++++-------------------- 1 file changed, 16 insertions(+), 43 deletions(-) diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index f19de1425..47f541bc7 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -596,66 +596,39 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature { const scrollCooldown = 200; // Milliseconds to wait before allowing another scroll const scrollThreshold = 2; // Minimum scroll delta to trigger workspace change - const scrollDeltaMode0Cooldown = 200; // Cooldown for consecutive DOM_DELTA_PIXEL events toolbox.addEventListener( 'wheel', async (event) => { if (this.privateWindowOrDisabled) return; - // Allow DOM_DELTA_LINE (1) and DOM_DELTA_PIXEL (0) events - if (event.deltaMode > 1) return; + // Only process non-gesture scrolls + if (event.deltaMode !== 1) return; - // Add cooling to consecutive DOM_DELTA_PIXEL events, which are usually from touchpads - if (event.deltaMode === 0) { - const now = Date.now(); - const timeSinceLastDeltaMode0 = now - (this._lastDeltaMode0Time || 0); - this._lastDeltaMode0Time = now; + const isVerticalScroll = event.deltaY && !event.deltaX; + + //if the scroll is vertical this checks that a modifier key is used before proceeding + if (isVerticalScroll) { + const activationKeyMap = { + ctrl: event.ctrlKey, + alt: event.altKey, + shift: event.shiftKey, + meta: event.metaKey, + }; if ( - Math.abs(event.deltaY || 0) === 0 && - timeSinceLastDeltaMode0 < scrollDeltaMode0Cooldown + this.activationMethod in activationKeyMap && + !activationKeyMap[this.activationMethod] ) { return; } } - const absX = Math.abs(event.deltaX || 0); - const absY = Math.abs(event.deltaY || 0); - - const isVerticalScroll = absY > absX * 2; - const isHorizontalScroll = absX > absY * 2; - - const activationKeyMap = { - ctrl: event.ctrlKey, - alt: event.altKey, - shift: event.shiftKey, - meta: event.metaKey, - }; - const modifierActive = - this.activationMethod in activationKeyMap && activationKeyMap[this.activationMethod]; - - let delta; - let shouldProceed = false; - - if (isVerticalScroll && modifierActive) { - // scroll is vertical + modifier key - delta = event.deltaY; - shouldProceed = true; - } else if (isHorizontalScroll) { - // clear horizontal scrolling - delta = event.deltaX; - shouldProceed = true; - } else { - // diagonal scrolling or unclear direction, ignore - return; - } - - if (!shouldProceed) return; - const currentTime = Date.now(); if (currentTime - this._lastScrollTime < scrollCooldown) return; + //this decides which delta to use + const delta = isVerticalScroll ? event.deltaY : event.deltaX; if (Math.abs(delta) < scrollThreshold) return; // Determine scroll direction From 702c37af321565b881bc1545d602d0a2fe74a723 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 13 Sep 2025 19:56:59 +0200 Subject: [PATCH 2/2] feat: Fixed blending modes for backgrounds on linux, b=no-bug, c=compact-mode, common --- .../browser/preferences/zen-preferences.ftl | 2 -- prefs/compact-mode.yaml | 3 --- .../components/preferences/zen-settings.js | 5 ----- .../preferences/zenLooksAndFeel.inc.xhtml | 3 --- src/browser/themes/linux/browser-css.patch | 5 +++-- src/zen/common/styles/zen-browser-ui.css | 15 +++++++-------- src/zen/common/styles/zen-theme.css | 13 +++++++++---- src/zen/compact-mode/zen-compact-mode.css | 4 ++++ 8 files changed, 23 insertions(+), 27 deletions(-) diff --git a/locales/en-US/browser/browser/preferences/zen-preferences.ftl b/locales/en-US/browser/browser/preferences/zen-preferences.ftl index c08008d54..5152d2044 100644 --- a/locales/en-US/browser/browser/preferences/zen-preferences.ftl +++ b/locales/en-US/browser/browser/preferences/zen-preferences.ftl @@ -57,8 +57,6 @@ zen-tabs-unloader-enabled = zen-look-and-feel-compact-toolbar-themed = .label = Use themed background for compact toolbar -zen-look-and-feel-compact-sidebar-themed = - .label = Use themed background for compact sidebar zen-workspace-continue-where-left-off = .label = Continue where you left off diff --git a/prefs/compact-mode.yaml b/prefs/compact-mode.yaml index 24657e673..157405033 100644 --- a/prefs/compact-mode.yaml +++ b/prefs/compact-mode.yaml @@ -20,9 +20,6 @@ - name: zen.view.compact.color-toolbar value: true -- name: zen.view.compact.color-sidebar - value: true - - name: zen.view.compact.animate-sidebar value: true diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js index d5d54b51d..e11ba8783 100644 --- a/src/browser/components/preferences/zen-settings.js +++ b/src/browser/components/preferences/zen-settings.js @@ -1135,11 +1135,6 @@ Preferences.addAll([ type: 'string', default: 'float', }, - { - id: 'zen.view.compact.color-sidebar', - type: 'bool', - default: true, - }, { id: 'zen.workspaces.separate-essentials', type: 'bool', diff --git a/src/browser/components/preferences/zenLooksAndFeel.inc.xhtml b/src/browser/components/preferences/zenLooksAndFeel.inc.xhtml index 260b08b57..76bb95718 100644 --- a/src/browser/components/preferences/zenLooksAndFeel.inc.xhtml +++ b/src/browser/components/preferences/zenLooksAndFeel.inc.xhtml @@ -100,9 +100,6 @@ - diff --git a/src/browser/themes/linux/browser-css.patch b/src/browser/themes/linux/browser-css.patch index 4478db4a7..dfaee3e7d 100644 --- a/src/browser/themes/linux/browser-css.patch +++ b/src/browser/themes/linux/browser-css.patch @@ -1,5 +1,5 @@ diff --git a/browser/themes/linux/browser.css b/browser/themes/linux/browser.css -index 9723a8199cc5b8d25bb92c46992792b8c94a3565..3496c3ae4bacf39b788f1b0f740e89cdd9d7de5b 100644 +index 9723a8199cc5b8d25bb92c46992792b8c94a3565..302f5b675abd1970e64f56a5a4592bb174f9a72a 100644 --- a/browser/themes/linux/browser.css +++ b/browser/themes/linux/browser.css @@ -43,7 +43,8 @@ @@ -12,7 +12,7 @@ index 9723a8199cc5b8d25bb92c46992792b8c94a3565..3496c3ae4bacf39b788f1b0f740e89cd dialog::backdrop { border-top-left-radius: env(-moz-gtk-csd-titlebar-radius); border-top-right-radius: env(-moz-gtk-csd-titlebar-radius); -@@ -51,13 +52,10 @@ +@@ -51,13 +52,11 @@ /* stylelint-disable-next-line media-query-no-invalid */ @media -moz-pref("widget.gtk.rounded-bottom-corners.enabled") { @@ -24,6 +24,7 @@ index 9723a8199cc5b8d25bb92c46992792b8c94a3565..3496c3ae4bacf39b788f1b0f740e89cd body, - dialog::backdrop { + dialog::backdrop, ++ #zen-main-app-wrapper, + #zen-browser-background { /* Use an uniform clip to allow WebRender to optimize it better */ border-radius: env(-moz-gtk-csd-titlebar-radius); diff --git a/src/zen/common/styles/zen-browser-ui.css b/src/zen/common/styles/zen-browser-ui.css index e971eec0c..468021407 100644 --- a/src/zen/common/styles/zen-browser-ui.css +++ b/src/zen/common/styles/zen-browser-ui.css @@ -47,7 +47,6 @@ overflow: clip; isolation: isolate; - background: var(--zen-themed-toolbar-bg-transparent); &::after, &::before { @@ -71,12 +70,6 @@ } } - @media (-moz-pref('zen.view.grey-out-inactive-windows')) { - &:-moz-window-inactive { - background: InactiveCaption; - } - } - &::before { background: var(--zen-main-browser-background-old); opacity: calc(1 - var(--zen-background-opacity)); @@ -140,10 +133,16 @@ } #zen-main-app-wrapper { - background: transparent; + background: var(--zen-themed-toolbar-bg-transparent); /* See bug #8814, don't an overflow here as it causes issues * with firefox's rendering of the tab bar */ + @media (-moz-pref('zen.view.grey-out-inactive-windows')) { + &:-moz-window-inactive { + background: InactiveCaption; + } + } + & > * { z-index: 1; } diff --git a/src/zen/common/styles/zen-theme.css b/src/zen/common/styles/zen-theme.css index bf2a34ebc..9c9144890 100644 --- a/src/zen/common/styles/zen-theme.css +++ b/src/zen/common/styles/zen-theme.css @@ -206,7 +206,7 @@ --tab-close-button-padding: 5px !important; --input-border-color: var(--zen-input-border-color) !important; - --zen-themed-toolbar-bg-transparent: transparent; + --zen-themed-toolbar-bg-transparent: light-dark(var(--zen-branding-bg), #171717); --zen-workspace-indicator-height: 46px; @@ -265,9 +265,14 @@ #main-window:not([chromehidden~='toolbar']) { min-height: 495px !important; - background: transparent; - @media (-moz-windows-mica) and (not (-moz-pref('widget.windows.mica.toplevel-backdrop', 1))) and (not (-moz-pref('widget.windows.mica.toplevel-backdrop', 2))) { - --zen-themed-toolbar-bg-transparent: rgba(255, 255, 255, 0.2); + @media (-moz-windows-mica) or (-moz-platform: macos) or ((-moz-platform: linux) and + -moz-pref('zen.widget.linux.transparency')) { + background: transparent; + --zen-themed-toolbar-bg-transparent: transparent; + + @media (-moz-windows-mica) and (not (-moz-pref('widget.windows.mica.toplevel-backdrop', 1))) and (not (-moz-pref('widget.windows.mica.toplevel-backdrop', 2))) { + --zen-themed-toolbar-bg-transparent: rgba(255, 255, 255, 0.2); + } } &, diff --git a/src/zen/compact-mode/zen-compact-mode.css b/src/zen/compact-mode/zen-compact-mode.css index ee9346b9b..a40765545 100644 --- a/src/zen/compact-mode/zen-compact-mode.css +++ b/src/zen/compact-mode/zen-compact-mode.css @@ -154,11 +154,15 @@ @media -moz-pref('zen.theme.acrylic-elements') { backdrop-filter: blur(42px) saturate(110%) brightness(0.25) contrast(100%) !important; } + &::before, &::after { outline: 1px solid rgba(255, 255, 255, .15); outline-offset: -1px; + background-attachment: fixed !important; + background-size: 2000px !important; } + &, &::before, &::after {