Fixed common issues with workspaces and the new empty tab

This commit is contained in:
mr. m
2025-02-20 11:53:33 +01:00
parent 61311bd3e6
commit c1870fee32
6 changed files with 77 additions and 25 deletions

View File

@@ -0,0 +1,13 @@
diff --git a/browser/components/tabbrowser/content/browser-ctrlTab.js b/browser/components/tabbrowser/content/browser-ctrlTab.js
index e5d16e605b7edf11fc9f52b93e415087b76398f1..feb7ccfc0562efda56177a75454a9f83a332e8d1 100644
--- a/browser/components/tabbrowser/content/browser-ctrlTab.js
+++ b/browser/components/tabbrowser/content/browser-ctrlTab.js
@@ -761,7 +761,7 @@ var ctrlTab = {
_initRecentlyUsedTabs() {
this._recentlyUsedTabs = Array.prototype.filter.call(
gBrowser.tabs,
- tab => !tab.closing && !tab.hidden
+ tab => !tab.closing && !tab.hidden && !tab.hasAttribute("zen-empty-tab")
);
this._sortRecentlyUsedTabs();
},

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..cb4a77fa5992b9890dfc55cb3c3c558d07912bb1 100644
index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5ae4351d7438c0e03c0a24551c910d43a2c676bd 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -406,11 +406,52 @@
@@ -365,6 +365,24 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..cb4a77fa5992b9890dfc55cb3c3c558d
if (!this._windowIsClosing) {
if (wasPinned) {
this.tabContainer._positionPinnedTabs();
@@ -5025,7 +5132,7 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) {
- return aTab.owner;
+ return ZenWorkspaces.findTabToBlur(aTab.owner);
}
// Try to find a remaining tab that comes after the given tab
@@ -5047,7 +5154,7 @@
}
if (tab) {
- return tab;
+ return ZenWorkspaces.findTabToBlur(tab);
}
// If no qualifying visible tab was found, see if there is a tab in
@@ -5465,10 +5572,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
}

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index 8aeb244ffca9f48661805f5b7d860b5896055562..b2e3b6c9c37eb1a070bbea72d629f9f72676f5bf 100644
index 8aeb244ffca9f48661805f5b7d860b5896055562..c96e563a31b4c32c855cc2d250d702361b427f88 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -94,7 +94,7 @@
@@ -151,6 +151,15 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..b2e3b6c9c37eb1a070bbea72d629f9f7
return children.filter(node => node.tagName == "tab-group");
}
@@ -1540,7 +1568,7 @@
*/
get visibleTabs() {
if (!this.#visibleTabs) {
- this.#visibleTabs = this.openTabs.filter(tab => tab.visible);
+ this.#visibleTabs = this.openTabs.filter(tab => tab.visible && !tab.hasAttribute("zen-empty-tab"));
}
return this.#visibleTabs;
}
@@ -1574,10 +1602,8 @@
return this.#focusableItems;
}
@@ -160,7 +169,7 @@ index 8aeb244ffca9f48661805f5b7d860b5896055562..b2e3b6c9c37eb1a070bbea72d629f9f7
- );
- let children = Array.from(this.arrowScrollbox.children);
+ let verticalPinnedTabsContainer = this.verticalPinnedTabsContainer;
+ let children = Array.from(ZenWorkspaces.tabboxChildrenWithoutEmpty);
+ let children = ZenWorkspaces.tabboxChildrenWithoutEmpty;
let focusableItems = [];
for (let child of children) {