fix: Fixed split view splitters showing up when opening glance, b=closes #11641, c=split-view

This commit is contained in:
mr. m
2025-12-20 00:26:03 +01:00
parent 3e5c355543
commit cf4c754e57

View File

@@ -1021,14 +1021,20 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
let tab = window.gBrowser.getTabForBrowser(browser); let tab = window.gBrowser.getTabForBrowser(browser);
const ignoreSplit = tab.hasAttribute('zen-dont-split-glance'); const ignoreSplit = tab.hasAttribute('zen-dont-split-glance');
tab.removeAttribute('zen-dont-split-glance'); tab.removeAttribute('zen-dont-split-glance');
let isGlanceTab = false;
if (tab.hasAttribute('zen-glance-tab') && !ignoreSplit) { if (tab.hasAttribute('zen-glance-tab') && !ignoreSplit) {
// Extract from parent node so we are not selecting the wrong (current) tab // Extract from parent node so we are not selecting the wrong (current) tab
tab = tab.parentNode.closest('.tabbrowser-tab'); tab = tab.parentNode.closest('.tabbrowser-tab');
isGlanceTab = true;
console.assert(tab, 'Tab not found for zen-glance-tab'); console.assert(tab, 'Tab not found for zen-glance-tab');
} }
if (tab) { if (tab) {
this.updateSplitView(tab); this.updateSplitView(tab);
tab.linkedBrowser.docShellIsActive = true; tab.linkedBrowser.docShellIsActive = true;
if (isGlanceTab) {
// See issues https://github.com/zen-browser/desktop/issues/11641
this.removeSplitters();
}
} }
this._maybeRemoveFakeBrowser(); this._maybeRemoveFakeBrowser();
{ {
@@ -1168,7 +1174,6 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
const oldView = this.currentView; const oldView = this.currentView;
const newView = this._data.findIndex((group) => group.tabs.includes(tab)); const newView = this._data.findIndex((group) => group.tabs.includes(tab));
if (oldView === newView) return;
if (newView < 0 && oldView >= 0) { if (newView < 0 && oldView >= 0) {
this.deactivateCurrentSplitView(); this.deactivateCurrentSplitView();
return; return;