From ba48b736e0b5f7a6a5bc324a951060b8b274cf94 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sun, 31 Aug 2025 14:20:17 +0200 Subject: [PATCH] feat: Only close the tab when wheel clicking the tab, b=no-bug, c=tabs --- src/zen/tabs/ZenPinnedTabManager.mjs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index dd4e92747..7d718f0d6 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -603,7 +603,7 @@ async _onTabClick(e) { const tab = e.target?.closest('tab'); if (e.button === 1 && tab) { - await this._onCloseTabShortcut(e, tab); + await this._onCloseTabShortcut(e, tab, { closeIfPending: true }); } } @@ -750,7 +750,11 @@ async _onCloseTabShortcut( event, selectedTab = gBrowser.selectedTab, - { behavior = lazy.zenPinnedTabCloseShortcutBehavior, noClose = false } = {} + { + behavior = lazy.zenPinnedTabCloseShortcutBehavior, + noClose = false, + closeIfPending = false, + } = {} ) { if (!selectedTab?.pinned) { return; @@ -806,7 +810,7 @@ tabsToUnload = selectedTab.group.tabs; } const allAreUnloaded = tabsToUnload.every((tab) => tab.hasAttribute('pending')); - if (allAreUnloaded) { + if (allAreUnloaded && closeIfPending) { return await this._onCloseTabShortcut(event, selectedTab, { behavior: 'close' }); } await gBrowser.explicitUnloadTabs(tabsToUnload);