diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index bd389cbb..dc67ed49 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -759,6 +759,7 @@ Singleton { "fontScale": 1.0, "iconScale": 1.0, "autoHide": false, + "autoHideStrict": false, "autoHideDelay": 250, "showOnWindowsOpen": false, "openOnOverview": false, diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index 2ec3db82..b37ad5ca 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -484,6 +484,7 @@ var SPEC = { fontScale: 1.0, iconScale: 1.0, autoHide: false, + autoHideStrict: false, autoHideDelay: 250, showOnWindowsOpen: false, openOnOverview: false, diff --git a/quickshell/Modules/DankBar/DankBarWindow.qml b/quickshell/Modules/DankBar/DankBarWindow.qml index 8f5664a0..b7ea7560 100644 --- a/quickshell/Modules/DankBar/DankBarWindow.qml +++ b/quickshell/Modules/DankBar/DankBarWindow.qml @@ -817,11 +817,51 @@ PanelWindow { interval: barWindow.clickThroughEnabled ? Math.max((barConfig?.autoHideDelay ?? 250) * 6, 1500) : (barConfig?.autoHideDelay ?? 250) repeat: false onTriggered: { - if (!topBarMouseArea.containsMouse) + if (!topBarMouseArea.containsMouse && !topBarCore.popoutPinsReveal) topBarCore.revealSticky = false; } } + property bool hasActivePopout: false + + readonly property bool popoutPinsReveal: !!(hasActivePopout && !(barConfig?.autoHideStrict ?? false)) + + onHasActivePopoutChanged: evaluateReveal() + + onPopoutPinsRevealChanged: evaluateReveal() + + function updateActivePopoutState() { + if (!barWindow.screen) + return; + const screenName = barWindow.screen.name; + const activePopout = PopoutManager.currentPopoutsByScreen[screenName]; + const activeTrayMenu = TrayMenuManager.activeTrayMenus[screenName]; + const trayOpen = rootWindow.systemTrayMenuOpen; + + const hasVisiblePopout = activePopout && activePopout.shouldBeVisible; + topBarCore.hasActivePopout = !!(hasVisiblePopout || activeTrayMenu || trayOpen); + } + + Connections { + target: PopoutManager + + function onPopoutChanged() { + topBarCore.updateActivePopoutState(); + } + + function onPopoutOpening() { + topBarCore.evaluateReveal(); + } + } + + Connections { + target: TrayMenuManager + + function onActiveTrayMenusChanged() { + topBarCore.updateActivePopoutState(); + } + } + property bool reveal: { if (barWindow.hasFullscreenToplevel) return false; @@ -833,24 +873,27 @@ PanelWindow { const showOnWindowsSetting = barConfig?.showOnWindowsOpen ?? false; if (showOnWindowsSetting && autoHide && (CompositorService.isNiri || CompositorService.isHyprland)) { if (barWindow.shouldHideForWindows) - return topBarMouseArea.containsMouse || revealSticky || ipcReveal; + return topBarMouseArea.containsMouse || popoutPinsReveal || revealSticky || ipcReveal; return true; } if (CompositorService.isNiri && NiriService.inOverview) - return topBarMouseArea.containsMouse || revealSticky || ipcReveal; + return topBarMouseArea.containsMouse || popoutPinsReveal || revealSticky || ipcReveal; - return (barConfig?.visible ?? true) && (!autoHide || topBarMouseArea.containsMouse || revealSticky || ipcReveal); + return (barConfig?.visible ?? true) && (!autoHide || topBarMouseArea.containsMouse || popoutPinsReveal || revealSticky || ipcReveal); } Connections { function onBarConfigChanged() { topBarCore.autoHide = barConfig?.autoHide ?? false; + topBarCore.evaluateReveal(); } target: rootWindow } + Component.onCompleted: topBarCore.updateActivePopoutState() + function evaluateReveal() { if (!autoHide) return; @@ -862,6 +905,12 @@ PanelWindow { return; } + if (popoutPinsReveal) { + revealSticky = true; + revealHold.stop(); + return; + } + revealHold.restart(); } @@ -885,7 +934,7 @@ PanelWindow { bottom: barWindow.isVertical ? parent.bottom : undefined } readonly property bool inOverview: CompositorService.isNiri && NiriService.inOverview && barWindow.effectiveOpenOnOverview - hoverEnabled: (barConfig?.autoHide ?? false) && !inOverview && !barWindow.hasFullscreenToplevel + hoverEnabled: (barConfig?.autoHide ?? false) && !inOverview && !barWindow.hasFullscreenToplevel && !topBarCore.popoutPinsReveal acceptedButtons: Qt.NoButton enabled: (barConfig?.autoHide ?? false) && !inOverview && !barWindow.hasFullscreenToplevel diff --git a/quickshell/Modules/Settings/DankBarTab.qml b/quickshell/Modules/Settings/DankBarTab.qml index 677758c6..7c3e487a 100644 --- a/quickshell/Modules/Settings/DankBarTab.qml +++ b/quickshell/Modules/Settings/DankBarTab.qml @@ -129,6 +129,7 @@ Item { fontScale: defaultBar.fontScale ?? 1.0, iconScale: defaultBar.iconScale ?? 1.0, autoHide: defaultBar.autoHide ?? false, + autoHideStrict: defaultBar.autoHideStrict ?? false, autoHideDelay: defaultBar.autoHideDelay ?? 250, showOnWindowsOpen: defaultBar.showOnWindowsOpen ?? false, openOnOverview: defaultBar.openOnOverview ?? false, @@ -641,6 +642,18 @@ Item { } } + SettingsToggleRow { + width: parent.width - parent.leftPadding + text: I18n.tr("Strict auto-hide", "Dank bar setting: hide the bar when the pointer leaves even if a menu or bar popover is still open") + checked: selectedBarConfig?.autoHideStrict ?? false + onToggled: toggled => { + SettingsData.updateBarConfig(selectedBarId, { + autoHideStrict: toggled + }); + notifyHorizontalBarChange(); + } + } + SettingsToggleRow { width: parent.width - parent.leftPadding visible: CompositorService.isNiri || CompositorService.isHyprland diff --git a/quickshell/translations/settings_search_index.json b/quickshell/translations/settings_search_index.json index 03f9e9eb..20ed8fe6 100644 --- a/quickshell/translations/settings_search_index.json +++ b/quickshell/translations/settings_search_index.json @@ -933,9 +933,12 @@ "dank", "hidden", "hide", + "menu", "panel", + "popover", "show", "statusbar", + "strict", "topbar", "visibility", "visible"