From 73d183120b00ac4205db04e83840ea288513e549 Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Fri, 24 Oct 2025 06:01:52 +0300 Subject: [PATCH] Show autohiding toolbars when a window modal dialog is open. Toolbar layout properties, notably --urlbar-container-height, is re-computed when window modal dialog is closed and the values would be totally incorrect if the toolbars are hidden at that time. This fixes #582 and likely several other issues as well. --- chrome/autohide_bookmarks_and_main_toolbars.css | 9 ++++++++- chrome/autohide_toolbox.css | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/chrome/autohide_bookmarks_and_main_toolbars.css b/chrome/autohide_bookmarks_and_main_toolbars.css index a7b3245..2c64db1 100644 --- a/chrome/autohide_bookmarks_and_main_toolbars.css +++ b/chrome/autohide_bookmarks_and_main_toolbars.css @@ -20,7 +20,7 @@ See the above repository for updates as well as full license text. */ --uc-navbar-height: 0px; } /* At least on Windows 10 display scaling > 100% causes 1px gap to appear below tabs depending on Firefox - * density settings and whether or not menubar is enabled. + * density settings and whether or not menubar is enabled. */ @media (min-resolution: 120dpi){ :root[uidensity="compact"] #navigator-toolbox:has(> #toolbar-menubar:is([autohide="false"],not([autohide]))){ @@ -80,6 +80,7 @@ See the above repository for updates as well as full license text. */ transform-origin: 0px calc((var(--urlbar-container-height) - var(--urlbar-height)) / 2); transform: rotateX(89.5deg); } +:root[window-modal-open] #urlbar[popover], #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel)) ~ toolbox #urlbar[popover], #navigator-toolbox:is(:hover,:focus-within) #urlbar[popover], #urlbar-container > #urlbar[popover]:is([focused],[open]){ @@ -113,6 +114,12 @@ See the above repository for updates as well as full license text. */ /* Selected tab needs higher z-index now to "hide" the broder below it */ .tabbrowser-tab[selected]{ z-index: 3 !important; } +/* Show toolbars when a window modal dialog is open, otherwise toolbar layout breaks after closing the dialog */ +:root[window-modal-open] :is(#nav-bar,#PersonalToolbar){ + transition-delay: 100ms !important; + transform: rotateX(0); +} + /* SELECT TOOLBAR BEHAVIOR */ /* Comment out or delete one of these to disable that behavior */ diff --git a/chrome/autohide_toolbox.css b/chrome/autohide_toolbox.css index f4adcd1..96c60f8 100644 --- a/chrome/autohide_toolbox.css +++ b/chrome/autohide_toolbox.css @@ -42,6 +42,8 @@ See the above repository for updates as well as full license text. */ transform-origin: 0px calc(0px - var(--tab-min-height) - var(--tab-block-margin) * 2); transform: rotateX(89.9deg); } + +:root[window-modal-open] #urlbar[popover], #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel)) ~ toolbox #urlbar[popover], #navigator-toolbox:is(:hover,:focus-within,[movingtab]) #urlbar[popover], #urlbar-container > #urlbar[popover]:is([focused],[open]){ @@ -50,6 +52,8 @@ See the above repository for updates as well as full license text. */ transition-delay: 33ms; transform: rotateX(0deg); } + +:root[window-modal-open] #navigator-toolbox, #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#selection-shortcut-action-panel,#chat-shortcuts-options-panel,#tab-preview-panel)) ~ toolbox, #navigator-toolbox:has(#urlbar:is([open],[focus-within])), #navigator-toolbox:is(:hover,:focus-within,[movingtab]){