From 644bf48b6cc4e41f62f39adecd877b0d248e9cab Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Mon, 14 Sep 2026 20:56:36 +0200 Subject: [PATCH] gh-13196: Fixed sidebar not hiding if the urlbar is open (gh-15403) --- src/zen/common/modules/ZenUIManager.mjs | 9 +-------- src/zen/common/styles/zen-browser-container.css | 2 +- src/zen/common/styles/zen-browser-ui.css | 4 ++-- src/zen/common/styles/zen-theme.css | 2 +- src/zen/compact-mode/ZenCompactMode.mjs | 10 +++++----- src/zen/drag-and-drop/ZenDragAndDrop.js | 8 +++++++- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/zen/common/modules/ZenUIManager.mjs b/src/zen/common/modules/ZenUIManager.mjs index 9d6a829f2..98ba56e20 100644 --- a/src/zen/common/modules/ZenUIManager.mjs +++ b/src/zen/common/modules/ZenUIManager.mjs @@ -990,14 +990,7 @@ window.gZenVerticalTabsManager = { }); ChromeUtils.defineLazyGetter(this, "hidesTabsToolbar", () => { - return ( - document.documentElement - .getAttribute("chromehidden") - ?.includes("toolbar") || - document.documentElement - .getAttribute("chromehidden") - ?.includes("menubar") - ); + return document.documentElement.hasAttribute("popup-window"); }); XPCOMUtils.defineLazyPreferenceGetter( diff --git a/src/zen/common/styles/zen-browser-container.css b/src/zen/common/styles/zen-browser-container.css index 78db52f6b..534a3dd2e 100644 --- a/src/zen/common/styles/zen-browser-container.css +++ b/src/zen/common/styles/zen-browser-container.css @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -:root:not([inDOMFullscreen="true"]):not([chromehidden~="location"]):not([chromehidden~="toolbar"]) { +:root:not([inDOMFullscreen="true"]):not([popup-window]) { & #tabbrowser-tabbox #tabbrowser-tabpanels .browserSidebarContainer { --zen-transparent-browser-background: light-dark(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.1)); overflow: clip; diff --git a/src/zen/common/styles/zen-browser-ui.css b/src/zen/common/styles/zen-browser-ui.css index 7308f9e58..9d3201960 100644 --- a/src/zen/common/styles/zen-browser-ui.css +++ b/src/zen/common/styles/zen-browser-ui.css @@ -20,7 +20,7 @@ body, position: inherit; } -:root:is([inDOMFullscreen="true"], [chromehidden~="location"], [chromehidden~="toolbar"]) { +:root:is([inDOMFullscreen="true"], [popup-window]) { #navigator-toolbox, #zen-sidebar-splitter { visibility: collapse; @@ -170,7 +170,7 @@ body, min-width: 1px; } -:root:not([inDOMFullscreen="true"]):not([chromehidden~="location"]):not([chromehidden~="toolbar"]) { +:root:not([inDOMFullscreen="true"]):not([popup-window]) { & #zen-tabbox-wrapper { margin: var(--zen-element-separation); margin-top: 0; diff --git a/src/zen/common/styles/zen-theme.css b/src/zen/common/styles/zen-theme.css index b252a263c..f478aef1f 100644 --- a/src/zen/common/styles/zen-theme.css +++ b/src/zen/common/styles/zen-theme.css @@ -303,7 +303,7 @@ } } -#main-window[windowtype="navigator:browser"]:not([chromehidden~='toolbar']) { +#main-window[windowtype="navigator:browser"]:not([popup-window]) { min-height: 495px !important; @media (-moz-windows-mica) or (-moz-platform: macos) or ((-moz-platform: linux) and diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 72b897db5..56ffcc956 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -165,9 +165,7 @@ window.gZenCompactModeManager = { }, get shouldBeCompact() { - return !document.documentElement - .getAttribute("chromehidden") - ?.includes("toolbar"); + return !document.documentElement.hasAttribute("popup-window"); }, set preference(value) { @@ -864,7 +862,6 @@ window.gZenCompactModeManager = { "supress-primary-adjustment" ) === "true" && gZenVerticalTabsManager._hasSetSingleToolbar) || - this._hasHoveredUrlbar || this._ignoreNextHover || (event.type === "dragleave" && event.explicitOriginalTarget !== target && @@ -877,7 +874,10 @@ window.gZenCompactModeManager = { return; } - if (this.hoverableElements[i].keepHoverDuration) { + if ( + this.hoverableElements[i].keepHoverDuration && + !this._hasHoveredUrlbar + ) { this.flashElement( target, this.hoverableElements[i].keepHoverDuration, diff --git a/src/zen/drag-and-drop/ZenDragAndDrop.js b/src/zen/drag-and-drop/ZenDragAndDrop.js index b66dd9331..b73499014 100644 --- a/src/zen/drag-and-drop/ZenDragAndDrop.js +++ b/src/zen/drag-and-drop/ZenDragAndDrop.js @@ -1040,12 +1040,16 @@ } this.clearSpaceSwitchTimer(); gZenFolders.highlightGroupOnDragOver(null); + // A drop into a split merges the tab away; nothing lands on it. + const toSplit = !!this.#dragOverSplit.canDrop; super.handle_drop(event); this.#maybeClearVerticalPinnedGridDragOver(); this.#handle_dropSwitchSpace(event); this.#handle_dropCreateSplit(event); this._clearDragOverSplit(); - this.#landDragImage(event); + if (!toSplit) { + this.#landDragImage(event); + } } /** @@ -1130,6 +1134,7 @@ ); } + // eslint-disable-next-line complexity handle_drop_transition(dropElement, draggedTab, movingTabs, dropBefore) { if ( dropElement?.hasAttribute("zen-empty-tab") && @@ -1155,6 +1160,7 @@ try { if ( this.#isAnimatingTabMove || + this.#dragOverSplit.canDrop || !gZenStartup.isReady || gReduceMotion || !dropElement ||