This commit is contained in:
Mr. M
2025-05-18 12:29:42 +02:00
4 changed files with 12 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/toolkit/content/widgets/arrowscrollbox.js b/toolkit/content/widgets/arrowscrollbox.js diff --git a/toolkit/content/widgets/arrowscrollbox.js b/toolkit/content/widgets/arrowscrollbox.js
index f9191af09f1b7a1654aff62807e7dad573afc172..f94a8b3dc5871fba5d0dbed5d487d6e32a1ff29a 100644 index f9191af09f1b7a1654aff62807e7dad573afc172..0b81a2bf5a0e1d745623f9b72fbe57254c1b16dd 100644
--- a/toolkit/content/widgets/arrowscrollbox.js --- a/toolkit/content/widgets/arrowscrollbox.js
+++ b/toolkit/content/widgets/arrowscrollbox.js +++ b/toolkit/content/widgets/arrowscrollbox.js
@@ -98,6 +98,7 @@ @@ -98,6 +98,7 @@
@@ -15,7 +15,7 @@ index f9191af09f1b7a1654aff62807e7dad573afc172..f94a8b3dc5871fba5d0dbed5d487d6e3
on_wheel(event) { on_wheel(event) {
// Don't consume the event if we can't scroll. // Don't consume the event if we can't scroll.
- if (!this.overflowing) { - if (!this.overflowing) {
+ if (!this.overflowing || this.id === 'tabbrowser-arrowscrollbox') { // we handle this on ZenStartup + if (!this.overflowing || this.id === 'tabbrowser-arrowscrollbox' || (event.deltaY == 0 && this.classList.contains('workspace-arrowscrollbox'))) {
return; return;
} }

View File

@@ -6,7 +6,7 @@
<hbox class="zen-current-workspace-indicator-icon"></hbox> <hbox class="zen-current-workspace-indicator-icon"></hbox>
<hbox class="zen-current-workspace-indicator-name"></hbox> <hbox class="zen-current-workspace-indicator-name"></hbox>
</vbox> </vbox>
<arrowscrollbox orient="vertical" tabindex="-1"> <arrowscrollbox orient="vertical" tabindex="-1" class="workspace-arrowscrollbox">
<vbox class="zen-workspace-tabs-section zen-workspace-pinned-tabs-section"> <vbox class="zen-workspace-tabs-section zen-workspace-pinned-tabs-section">
<html:div class="vertical-pinned-tabs-container-separator"></html:div> <html:div class="vertical-pinned-tabs-container-separator"></html:div>
</vbox> </vbox>
@@ -77,6 +77,13 @@
get: () => 36, get: () => 36,
}); });
if (
Services.prefs.getBoolPref('zen.workspaces.swipe-actions', false) &&
gZenWorkspaces.workspaceEnabled
) {
gZenWorkspaces.attachGestureHandlers(this);
}
// Add them manually since attribute inheritance doesn't work // Add them manually since attribute inheritance doesn't work
// for multiple layers of shadow DOM. // for multiple layers of shadow DOM.
this.tabsContainer.setAttribute('zen-workspace-id', this.id); this.tabsContainer.setAttribute('zen-workspace-id', this.id);

View File

@@ -138,7 +138,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
Services.prefs.getBoolPref('zen.workspaces.swipe-actions', false) && Services.prefs.getBoolPref('zen.workspaces.swipe-actions', false) &&
this.workspaceEnabled this.workspaceEnabled
) { ) {
this.initializeGestureHandlers();
this.initializeWorkspaceNavigation(); this.initializeWorkspaceNavigation();
} }
@@ -576,21 +575,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
); );
} }
initializeGestureHandlers() {
const elements = [
gNavToolbox,
// event handlers do not work on elements inside shadow DOM so we need to attach them directly
document.getElementById('tabbrowser-arrowscrollbox').shadowRoot.querySelector('scrollbox'),
];
// Attach gesture handlers to each element
for (const element of elements) {
if (!element) continue;
this.attachGestureHandlers(element);
}
}
attachGestureHandlers(element) { attachGestureHandlers(element) {
element.addEventListener('MozSwipeGestureMayStart', this._handleSwipeMayStart.bind(this), true); element.addEventListener('MozSwipeGestureMayStart', this._handleSwipeMayStart.bind(this), true);
element.addEventListener('MozSwipeGestureStart', this._handleSwipeStart.bind(this), true); element.addEventListener('MozSwipeGestureStart', this._handleSwipeStart.bind(this), true);

View File

@@ -543,7 +543,7 @@ zen-workspace {
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 2px; height: 1px;
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
transition: opacity 0.1s; transition: opacity 0.1s;
@@ -556,7 +556,7 @@ zen-workspace {
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 2px; height: 1px;
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
transition: opacity 0.1s; transition: opacity 0.1s;