From 90fe7d8e03ee8e44b0d6bac55374bd2902fc7ae4 Mon Sep 17 00:00:00 2001 From: Bridget Morningstar <168581144+neurokitti@users.noreply.github.com> Date: Thu, 28 Nov 2024 22:19:25 -0600 Subject: [PATCH 1/5] adds ability to scroll between workspaces as well as fixing the issue with trackpad --- src/browser/app/profile/zen-browser.js | 2 + .../base/zen-components/ZenWorkspaces.mjs | 99 +++++++++++++------ .../components/preferences/zen-settings.js | 10 ++ 3 files changed, 82 insertions(+), 29 deletions(-) diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js index 78b7c6d4a..b931cbd17 100644 --- a/src/browser/app/profile/zen-browser.js +++ b/src/browser/app/profile/zen-browser.js @@ -166,6 +166,8 @@ pref('zen.workspaces.force-container-workspace', false); pref('zen.workspaces.open-new-tab-if-last-unpinned-tab-is-closed', true); pref('zen.workspaces.show-workspace-indicator', true); pref('zen.workspaces.swipe-actions', true); +pref('zen.workspaces.wrap-around-navigation', true); +pref('zen.workspaces.scroll-modifier-key','ctrl'); // can be ctrl, alt, shift, or a meta key pref('zen.workspaces.icons', '["⌚","⌛","⏪","⏫","⏬","⏰","⏳","⚽","⚾","⛄","⛅","⛎","⛔","⛪","⛲","⛳","⛵","⛺","⛽","✅","✊","✋","✨","❌","❎","❓","⭐","⭕","🀄","🃏","🆎","🆑","🆒","🆓","🆔","🆕","🆖","🆗","🆘","🆙","🆚","🈁","🈚","🈯","🈲","🈳","🈴","🈵","🈶","🈸","🈹","🈺","🉐","🉑","🌀","🌁","🌂","🌃","🌄","🌅","🌆","🌇","🌈","🌉","🌊","🌋","🌌","🌍","🌎","🌏","🌐","🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘","🌙","🌚","🌛","🌜","🌝","🌞","🌟","🌠","🌭","🌮","🌯","🌰","🌱","🌲","🌳","🌴","🌵","🌷","🌸","🌹","🌺","🌻","🌼","🌽","🌾","🌿","🍀","🍁","🍂","🍃","🍄","🍅","🍆","🍇","🍈","🍉","🍊","🍋","🍌","🍍","🍎","🍏","🍐","🍑","🍒","🍓","🍔","🍕","🍖","🍗","🍘","🍙","🍚","🍛","🍜","🍝","🍞","🍟","🍠","🍡","🍢","🍣","🍤","🍥","🍦","🍧","🍨","🍩","🍪","🍫","🍬","🍭","🍮","🍯","🍰","🍱","🍲","🍳","🍴","🍵","🍶","🍷","🍸","🍹","🍺","🍻","🍼","🍾","🍿","🎀","🎁","🎂","🎃","🎄","🎅","🎆","🎇","🎈","🎉","🎊","🎋","🎌","🎍","🎎","🎏","🎐","🎑","🎒","🎓","🎠","🎡","🎢","🎣","🎤","🎥","🎦","🎧","🎨","🎩","🎪","🎫","🎬","🎭","🎮","🎯","🎰","🎱","🎲","🎳","🎴","🎵","🎶","🎷","🎸","🎹","🎺","🎻","🎼","🎽","🎾","🎿","🏀","🏁","🏂","🏃","🏄","🏅","🏆","🏇","🏈","🏉","🏊","🏏","🏐","🏑","🏒","🏓","🏠","🏡","🏢","🏣","🏤","🏥","🏦","🏧","🏨","🏩","🏪","🏫","🏬","🏭","🏮","🏯","🏰","🏴","🏸","🏹","🏺","🏻","🏼","🏽","🏾","🏿","🐀","🐁","🐂","🐃","🐄","🐅","🐆","🐇","🐈","🐉","🐊","🐋","🐌","🐍","🐎","🐏","🐐","🐑","🐒","🐓","🐔","🐕","🐖","🐗","🐘","🐙","🐚","🐛","🐜","🐝","🐞","🐟","🐠","🐡","🐢","🐣","🐤","🐥","🐦","🐧","🐨","🐩","🐪","🐫","🐬","🐭","🐮","🐯","🐰","🐱","🐲","🐳","🐴","🐵","🐶","🐷","🐸","🐹","🐺","🐻","🐼","🐽","🐾","👀","👂","👃","👄","👅","👆","👇","👈","👉","👊","👋","👌","👍","👎","👏","👐","👑","👒","👓","👔","👕","👖","👗","👘","👙","👚","👛","👜","👝","👞","👟","👠","👡","👢","👣","👤","👥","👦","👧","👨","👩","👪","👫","👬","👭","👮","👯","👰","👱","👲","👳","👴","👵","👶","👷","👸","👹","👺","👻","👼","👽","👾","👿","💀","💁","💂","💃","💄","💅","💆","💇","💈","💉","💊","💋","💌","💍","💎","💏","💐","💑","💒","💓","💔","💕","💖","💗","💘","💙","💚","💛","💜","💝","💞","💟","💠","💡","💢","💣","💤","💥","💦","💧","💨","💩","💪","💫","💬","💭","💮","💯","💰","💱","💲","💳","💴","💵","💶","💷","💸","💹","💺","💻","💼","💽","💾","💿","📀","📁","📂","📃","📄","📅","📆","📇","📈","📉","📊","📋","📌","📍","📎","📏","📐","📑","📒","📓","📔","📕","📖","📗","📘","📙","📚","📛","📜","📝","📞","📟","📠","📡","📢","📣","📤","📥","📦","📧","📨","📩","📪","📫","📬","📭","📮","📯","📰","📱","📲","📳","📴","📵","📶","📷","📸","📹","📺","📻","📼","📿","🔀","🔁","🔂","🔃","🔄","🔅","🔆","🔇","🔈","🔉","🔊","🔋","🔌","🔍","🔎","🔏","🔐","🔑","🔒","🔓","🔔","🔕","🔖","🔗","🔘","🔙","🔚","🔛","🔜","🔝","🔞","🔟","🔠","🔡","🔢","🔣","🔤","🔥","🔦","🔧","🔨","🔩","🔪","🔫","🔬","🔭","🔮","🔯","🔰","🔱","🔲","🔳","🔴","🔵","🔶","🔷","🔸","🔹","🔺","🔻","🔼","🔽","🕋","🕌","🕍","🕎","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚","🕛","🕜","🕝","🕞","🕟","🕠","🕡","🕢","🕣","🕤","🕥","🕦","🕧","🖕","🖖","🗻","🗼","🗽","🗾","🗿","😀","😁","😂","😃","😄","😅","😆","😇","😈","😉","😊","😋","😌","😍","😎","😏","😐","😑","😒","😓","😔","😕","😖","😗","😘","😙","😚","😛","😜","😝","😞","😟","😠","😡","😢","😣","😤","😥","😦","😧","😨","😩","😪","😫","😬","😭","😮","😯","😰","😱","😲","😳","😴","😵","😶","😷","😸","😹","😺","😻","😼","😽","😾","😿","🙀","🙁","🙂","🙃","🙄","🙅","🙆","🙇","🙈","🙉","🙊","🙋","🙌","🙍","🙎","🙏","🚀","🚁","🚂","🚃","🚄","🚅","🚆","🚇","🚈","🚉","🚊","🚋","🚌","🚍","🚎","🚏","🚐","🚑","🚒","🚓","🚔","🚕","🚖","🚗","🚘","🚙","🚚","🚛","🚜","🚝","🚞","🚟","🚠","🚡","🚢","🚣","🚤","🚥","🚦","🚧","🚨","🚩","🚪","🚫","🚬","🚭","🚮","🚯","🚰","🚱","🚲","🚳","🚴","🚵","🚶","🚷","🚸","🚹","🚺","🚻","🚼","🚽","🚾","🚿","🛀","🛁","🛂","🛃","🛄","🛅","🛌","🛐","🛫","🛬","🤐","🤑","🤒","🤓","🤔","🤕","🤖","🤗","🤘","🦀","🦁","🦂","🦃","🦄","🧀","🇦🇨","🇦🇩","🇦🇪","🇦🇫","🇦🇬","🇦🇮","🇦🇱","🇦🇲","🇦🇴","🇦🇶","🇦🇷","🇦🇸","🇦🇹","🇦🇺","🇦🇼","🇦🇽","🇦🇿","🇧🇦","🇧🇧","🇧🇩","🇧🇪","🇧🇫","🇧🇬","🇧🇭","🇧🇮","🇧🇯","🇧🇱","🇧🇲","🇧🇳","🇧🇴","🇧🇶","🇧🇷","🇧🇸","🇧🇹","🇧🇻","🇧🇼","🇧🇾","🇧🇿","🇨🇦","🇨🇨","🇨🇩","🇨🇫","🇨🇬","🇨🇭","🇨🇮","🇨🇰","🇨🇱","🇨🇲","🇨🇳","🇨🇴","🇨🇵","🇨🇷","🇨🇺","🇨🇻","🇨🇼","🇨🇽","🇨🇾","🇨🇿","🇩🇪","🇩🇬","🇩🇯","🇩🇰","🇩🇲","🇩🇴","🇩🇿","🇪🇦","🇪🇨","🇪🇪","🇪🇬","🇪🇭","🇪🇷","🇪🇸","🇪🇹","🇪🇺","🇫🇮","🇫🇯","🇫🇰","🇫🇲","🇫🇴","🇫🇷","🇬🇦","🇬🇧","🇬🇩","🇬🇪","🇬🇫","🇬🇬","🇬🇭","🇬🇮","🇬🇱","🇬🇲","🇬🇳","🇬🇵","🇬🇶","🇬🇷","🇬🇸","🇬🇹","🇬🇺","🇬🇼","🇬🇾","🇭🇰","🇭🇲","🇭🇳","🇭🇷","🇭🇹","🇭🇺","🇮🇨","🇮🇩","🇮🇪","🇮🇱","🇮🇲","🇮🇳","🇮🇴","🇮🇶","🇮🇷","🇮🇸","🇮🇹","🇯🇪","🇯🇲","🇯🇴","🇯🇵","🇰🇪","🇰🇬","🇰🇭","🇰🇮","🇰🇲","🇰🇳","🇰🇵","🇰🇷","🇰🇼","🇰🇾","🇰🇿","🇱🇦","🇱🇧","🇱🇨","🇱🇮","🇱🇰","🇱🇷","🇱🇸","🇱🇹","🇱🇺","🇱🇻","🇱🇾","🇲🇦","🇲🇨","🇲🇩","🇲🇪","🇲🇫","🇲🇬","🇲🇭","🇲🇰","🇲🇱","🇲🇲","🇲🇳","🇲🇴","🇲🇵","🇲🇶","🇲🇷","🇲🇸","🇲🇹","🇲🇺","🇲🇻","🇲🇼","🇲🇽","🇲🇾","🇲🇿","🇳🇦","🇳🇨","🇳🇪","🇳🇫","🇳🇬","🇳🇮","🇳🇱","🇳🇴","🇳🇵","🇳🇷","🇳🇺","🇳🇿","🇴🇲","🇵🇦","🇵🇪","🇵🇫","🇵🇬","🇵🇭","🇵🇰","🇵🇱","🇵🇲","🇵🇳","🇵🇷","🇵🇸","🇵🇹","🇵🇼","🇵🇾","🇶🇦","🇷🇪","🇷🇴","🇷🇸","🇷🇺","🇷🇼","🇸🇦","🇸🇧","🇸🇨","🇸🇩","🇸🇪","🇸🇬","🇸🇭","🇸🇮","🇸🇯","🇸🇰","🇸🇱","🇸🇲","🇸🇳","🇸🇴","🇸🇷","🇸🇸","🇸🇹","🇸🇻","🇸🇽","🇸🇾","🇸🇿","🇹🇦","🇹🇨","🇹🇩","🇹🇫","🇹🇬","🇹🇭","🇹🇯","🇹🇰","🇹🇱","🇹🇲","🇹🇳","🇹🇴","🇹🇷","🇹🇹","🇹🇻","🇹🇼","🇹🇿","🇺🇦","🇺🇬","🇺🇲","🇺🇸","🇺🇾","🇺🇿","🇻🇦","🇻🇨","🇻🇪","🇻🇬","🇻🇮","🇻🇳","🇻🇺","🇼🇫","🇼🇸","🇽🇰","🇾🇪","🇾🇹","🇿🇦","🇿🇲","🇿🇼"]'); pref('services.sync.prefs.sync.zen.workspaces.icons', true); pref('services.sync.engine.workspaces', false); diff --git a/src/browser/base/zen-components/ZenWorkspaces.mjs b/src/browser/base/zen-components/ZenWorkspaces.mjs index 1397596c8..164c6a62b 100644 --- a/src/browser/base/zen-components/ZenWorkspaces.mjs +++ b/src/browser/base/zen-components/ZenWorkspaces.mjs @@ -112,36 +112,71 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { _setupSidebarHandlers() { const toolbox = document.getElementById('navigator-toolbox'); - + toolbox.addEventListener('mouseenter', () => { this._hoveringSidebar = true; }); - + toolbox.addEventListener('mouseleave', () => { this._hoveringSidebar = false; }); - - const scrollCooldown = 500; // Milliseconds to wait before allowing another scroll - const scrollThreshold = 5; // Minimum scroll delta to trigger workspace change - + + const scrollCooldown = 200; // Milliseconds to wait before allowing another scroll + const scrollThreshold = 2; // Minimum scroll delta to trigger workspace change + toolbox.addEventListener('wheel', async (event) => { if (!this.workspaceEnabled) return; - // Only process horizontal scroll (deltaX) - if (!event.deltaX) return; - + + // Only process non-gesture scrolls + if (event.deltaMode !== 1) return; + + const isVerticalScroll = event.deltaY && !event.deltaX; + const isHorizontalScroll = event.deltaX && !event.deltaY; + + //if the scroll is vertical this checks that a modifier key is used before proceeding + if (isVerticalScroll) { + const activationMethod = Services.prefs.getStringPref('zen.workspaces.scroll-modifier-key', 'ctrl'); + const activationKeyMap = { + ctrl: event.ctrlKey, + alt: event.altKey, + shift: event.shiftKey, + meta: event.metaKey, + }; + + if (activationMethod in activationKeyMap && !activationKeyMap[activationMethod]) { + return; + } + } + const currentTime = Date.now(); - if (currentTime - this._lastScrollTime < scrollCooldown) { - return; + 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 + const direction = delta > 0 ? -1 : 1; + + // Workspace logic + const workspaces = (await this._workspaces()).workspaces; + const currentIndex = workspaces.findIndex(w => w.uuid === this.activeWorkspace); + if (currentIndex === -1) return; // No valid current workspace + + let targetIndex = currentIndex + direction; + + if (Services.prefs.getBoolPref('zen.workspaces.wrap-around-navigation', false)) { + // Add length to handle negative indices and loop + targetIndex = (targetIndex + workspaces.length) % workspaces.length; + } else { + // Clamp within bounds to disable looping + targetIndex = Math.max(0, Math.min(workspaces.length - 1, targetIndex)); } - - // Only process if the horizontal scroll is significant enough - if (Math.abs(event.deltaX) < scrollThreshold) { - return; + + if (targetIndex !== currentIndex) { + await this.changeWorkspace(workspaces[targetIndex]); } - - // Change workspace based on scroll direction - const direction = event.deltaX > 0 ? 1 : -1; - await this.changeWorkspaceShortcut(direction); + this._lastScrollTime = currentTime; }, { passive: true }); } @@ -212,26 +247,32 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { async _handleSwipeEnd(event) { if (!this.workspaceEnabled || !this._swipeState?.isGestureActive) return; - event.preventDefault(); event.stopPropagation(); - + if (this._swipeState.direction) { const workspaces = (await this._workspaces()).workspaces; const currentIndex = workspaces.findIndex(w => w.uuid === this.activeWorkspace); - + if (currentIndex !== -1) { const isRTL = document.documentElement.matches(':-moz-locale-dir(rtl)'); const moveForward = (this._swipeState.direction === 'right') !== isRTL; - - let targetIndex; - if (moveForward) { - targetIndex = (currentIndex + 1) % workspaces.length; + + let targetIndex = moveForward + ? currentIndex + 1 + : currentIndex - 1; + + if (Services.prefs.getBoolPref('zen.workspaces.wrap-around-navigation', false)) { + // Add length to handle negative indices and clamp within bounds + targetIndex = (targetIndex + workspaces.length) % workspaces.length; } else { - targetIndex = (currentIndex - 1 + workspaces.length) % workspaces.length; + // Clamp within bounds for to remove looping + targetIndex = Math.max(0, Math.min(workspaces.length - 1, targetIndex)); + } + + if (targetIndex !== currentIndex) { + await this.changeWorkspace(workspaces[targetIndex]); } - - await this.changeWorkspace(workspaces[targetIndex]); } } diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js index e0961cc1c..503d01ed6 100644 --- a/src/browser/components/preferences/zen-settings.js +++ b/src/browser/components/preferences/zen-settings.js @@ -1001,6 +1001,16 @@ Preferences.addAll([ type: 'bool', default: true, }, + { + id: 'zen.workspaces.wrap-around-navigation', + type: 'bool', + default: true, + }, + { + id: 'zen.workspaces.scroll-modifier-key', + type: "string", + default: "ctrl", + }, { id: 'zen.pinned-tab-manager.close-shortcut-behavior', type: 'string', From a869e7a3bd2be77a7c449ce19b2dbb7bcf00c815 Mon Sep 17 00:00:00 2001 From: Bridget Morningstar <168581144+neurokitti@users.noreply.github.com> Date: Thu, 28 Nov 2024 22:29:16 -0600 Subject: [PATCH 2/5] removed my spaces lol mb asdf --- src/browser/base/zen-components/ZenWorkspaces.mjs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/browser/base/zen-components/ZenWorkspaces.mjs b/src/browser/base/zen-components/ZenWorkspaces.mjs index 164c6a62b..dd87e7e64 100644 --- a/src/browser/base/zen-components/ZenWorkspaces.mjs +++ b/src/browser/base/zen-components/ZenWorkspaces.mjs @@ -112,18 +112,18 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { _setupSidebarHandlers() { const toolbox = document.getElementById('navigator-toolbox'); - + toolbox.addEventListener('mouseenter', () => { this._hoveringSidebar = true; }); - + toolbox.addEventListener('mouseleave', () => { this._hoveringSidebar = false; }); - + const scrollCooldown = 200; // Milliseconds to wait before allowing another scroll const scrollThreshold = 2; // Minimum scroll delta to trigger workspace change - + toolbox.addEventListener('wheel', async (event) => { if (!this.workspaceEnabled) return; @@ -249,11 +249,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { if (!this.workspaceEnabled || !this._swipeState?.isGestureActive) return; event.preventDefault(); event.stopPropagation(); - + if (this._swipeState.direction) { const workspaces = (await this._workspaces()).workspaces; const currentIndex = workspaces.findIndex(w => w.uuid === this.activeWorkspace); - + if (currentIndex !== -1) { const isRTL = document.documentElement.matches(':-moz-locale-dir(rtl)'); const moveForward = (this._swipeState.direction === 'right') !== isRTL; From 7112f77b7c9ea970ea24241ace9fdb88c9fcd764 Mon Sep 17 00:00:00 2001 From: Bridget Morningstar <168581144+neurokitti@users.noreply.github.com> Date: Tue, 3 Dec 2024 21:48:13 -0600 Subject: [PATCH 3/5] fix uses lazy getters --- .../base/zen-components/ZenWorkspaces.mjs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/browser/base/zen-components/ZenWorkspaces.mjs b/src/browser/base/zen-components/ZenWorkspaces.mjs index dd87e7e64..74700bb8e 100644 --- a/src/browser/base/zen-components/ZenWorkspaces.mjs +++ b/src/browser/base/zen-components/ZenWorkspaces.mjs @@ -28,6 +28,19 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { return; // We are in a hidden window, don't initialize ZenWorkspaces } this.ownerWindow = window; + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'activationMethod', + 'zen.workspaces.scroll-modifier-key', + 'ctrl', + this._expandWorkspacesStrip.bind(this) + ); + XPCOMUtils.defineLazyPreferenceGetter( + this, + 'shouldWrapAroundNavigation', + 'zen.workspaces.wrap-around-navigation', + true + ); XPCOMUtils.defineLazyPreferenceGetter( this, 'shouldShowIconStrip', @@ -135,7 +148,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { //if the scroll is vertical this checks that a modifier key is used before proceeding if (isVerticalScroll) { - const activationMethod = Services.prefs.getStringPref('zen.workspaces.scroll-modifier-key', 'ctrl'); + const activationKeyMap = { ctrl: event.ctrlKey, alt: event.altKey, @@ -143,7 +156,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { meta: event.metaKey, }; - if (activationMethod in activationKeyMap && !activationKeyMap[activationMethod]) { + if (this.activationMethod in activationKeyMap && !activationKeyMap[this.activationMethod]) { return; } } @@ -165,7 +178,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { let targetIndex = currentIndex + direction; - if (Services.prefs.getBoolPref('zen.workspaces.wrap-around-navigation', false)) { + if (this.shouldWrapAroundNavigation) { // Add length to handle negative indices and loop targetIndex = (targetIndex + workspaces.length) % workspaces.length; } else { From c1a9034f3f1a64b7bb6d96b6976d81a40e029bb1 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheff@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:12:40 +0100 Subject: [PATCH 4/5] Update zen-settings.js Signed-off-by: mr. m <91018726+mr-cheff@users.noreply.github.com> --- src/browser/components/preferences/zen-settings.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js index 862a2ccc0..ae4c55813 100644 --- a/src/browser/components/preferences/zen-settings.js +++ b/src/browser/components/preferences/zen-settings.js @@ -999,16 +999,6 @@ Preferences.addAll([ type: 'bool', default: true, }, - { - id: 'zen.workspaces.wrap-around-navigation', - type: 'bool', - default: true, - }, - { - id: 'zen.workspaces.scroll-modifier-key', - type: "string", - default: "ctrl", - }, { id: 'zen.pinned-tab-manager.close-shortcut-behavior', type: 'string', From df801995fff02e176af5664e3be660ea8cff21fb Mon Sep 17 00:00:00 2001 From: Studio Movie Girl <168581144+neurokitti@users.noreply.github.com> Date: Thu, 5 Dec 2024 10:20:29 -0600 Subject: [PATCH 5/5] Update ZenWorkspaces.mjs Signed-off-by: Studio Movie Girl <168581144+neurokitti@users.noreply.github.com> --- src/browser/base/zen-components/ZenWorkspaces.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/base/zen-components/ZenWorkspaces.mjs b/src/browser/base/zen-components/ZenWorkspaces.mjs index 74700bb8e..05feb15f9 100644 --- a/src/browser/base/zen-components/ZenWorkspaces.mjs +++ b/src/browser/base/zen-components/ZenWorkspaces.mjs @@ -275,7 +275,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature { ? currentIndex + 1 : currentIndex - 1; - if (Services.prefs.getBoolPref('zen.workspaces.wrap-around-navigation', false)) { + if (this.shouldWrapAroundNavigation) { // Add length to handle negative indices and clamp within bounds targetIndex = (targetIndex + workspaces.length) % workspaces.length; } else {