diff --git a/quickshell/Modules/Frame/FrameWindow.qml b/quickshell/Modules/Frame/FrameWindow.qml index 4ed35bf5a..bb6da59ad 100644 --- a/quickshell/Modules/Frame/FrameWindow.qml +++ b/quickshell/Modules/Frame/FrameWindow.qml @@ -235,6 +235,33 @@ PanelWindow { return Math.max(0, Math.round(Theme.px(value, win._dpr))); } + function _pointInBand(lx, ly, bx, by, bw, bh, pad) { + return lx >= bx - pad && lx < bx + bw + pad && ly >= by - pad && ly < by + bh + pad; + } + + function containsGlobalPoint(gx, gy, padding) { + if (!win._connectedActive || !win.contentItem) + return false; + const origin = win.contentItem.mapToItem(null, 0, 0); + if (!origin) + return false; + const pad = padding !== undefined ? padding : 16; + const lx = gx - origin.x; + const ly = gy - origin.y; + const w = win._windowRegionWidth; + const h = win._windowRegionHeight; + const edges = win.barEdges; + if (edges.includes("top") && win._pointInBand(lx, ly, 0, 0, w, win.cutoutTopInset, pad)) + return true; + if (edges.includes("bottom") && win._pointInBand(lx, ly, 0, h - win.cutoutBottomInset, w, win.cutoutBottomInset, pad)) + return true; + if (edges.includes("left") && win._pointInBand(lx, ly, 0, 0, win.cutoutLeftInset, h, pad)) + return true; + if (edges.includes("right") && win._pointInBand(lx, ly, w - win.cutoutRightInset, 0, win.cutoutRightInset, h, pad)) + return true; + return false; + } + readonly property int cutoutTopInset: win._regionInt(barEdges.includes("top") ? SettingsData.frameBarSize : SettingsData.frameThickness) readonly property int cutoutBottomInset: win._regionInt(barEdges.includes("bottom") ? SettingsData.frameBarSize : SettingsData.frameThickness) readonly property int cutoutLeftInset: win._regionInt(barEdges.includes("left") ? SettingsData.frameBarSize : SettingsData.frameThickness) @@ -1093,10 +1120,12 @@ PanelWindow { } Component.onCompleted: { + KeyboardFocus.registerBarWindow(win); win._scheduleBlurRebuild(); win._scheduleSurfaceRefresh(); } Component.onDestruction: { + KeyboardFocus.unregisterBarWindow(win); blurRebuildAction.cancel(); surfaceRefreshAction.cancel(); win._teardownBlur(); diff --git a/quickshell/Modules/Settings/DankBarTab.qml b/quickshell/Modules/Settings/DankBarTab.qml index dcc9459da..da2fe1360 100644 --- a/quickshell/Modules/Settings/DankBarTab.qml +++ b/quickshell/Modules/Settings/DankBarTab.qml @@ -1256,6 +1256,8 @@ Item { } SettingsToggleCard { + settingKey: "hoverPopouts" + tags: ["bar", "hover", "popout", "reveal", "widget", "delay"] iconName: "touch_app" title: I18n.tr("Hover Popouts") description: I18n.tr("Open widget popouts by hovering over the bar. Moving to another widget switches the popout.") diff --git a/quickshell/translations/settings_search_index.json b/quickshell/translations/settings_search_index.json index 5a7a348f0..51d8db0c5 100644 --- a/quickshell/translations/settings_search_index.json +++ b/quickshell/translations/settings_search_index.json @@ -772,6 +772,34 @@ ], "icon": "display_settings" }, + { + "section": "hoverPopouts", + "label": "Hover Popouts", + "tabIndex": 3, + "category": "Dank Bar", + "keywords": [ + "another", + "bar", + "dank", + "delay", + "hover", + "hovering", + "moving", + "open", + "over", + "panel", + "popout", + "popouts", + "reveal", + "statusbar", + "switches", + "taskbar", + "topbar", + "widget" + ], + "icon": "touch_app", + "description": "Open widget popouts by hovering over the bar. Moving to another widget switches the popout." + }, { "section": "barPosition", "label": "Position",