Dismiss bar panels when clicking on another monitor (#6487)

* Dismiss bar panels when clicking on another monitor

* Preserve keyboard focus for reopened panels

* Harden cross-monitor panel dismissal

* Wait for panel mapping before releasing focus

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
This commit is contained in:
Husam
2026-08-01 13:00:24 -05:00
committed by GitHub
co-authored by David Heinemeier Hansson
parent fa95901b6f
commit 3cb3861fbc
4 changed files with 127 additions and 24 deletions
+3 -3
View File
@@ -351,9 +351,9 @@ Panel {
Component.onCompleted: refresh()
// KeyboardPanel takes Exclusive focus at map-time, so SUPER-bound IPC
// summons land with j/k ready to navigate. Keep a default landing point,
// but don't paint the cursor until hover or the first navigation key.
// KeyboardPanel primes focus at open-time, so SUPER-bound IPC summons land
// with j/k ready to navigate. Keep a default landing point, but don't paint
// the cursor until hover or the first navigation key.
onOpenedChanged: {
if (opened) {
refresh()
+3 -5
View File
@@ -283,10 +283,8 @@ Panel {
readonly property color hoverFill: bar ? Style.hoverFillFor(bar.foreground, Color.accent) : "transparent"
readonly property color selectedFill: bar ? Style.selectedFillFor(bar.foreground, Color.accent) : "transparent"
// The panel below is its own layer-shell with Exclusive keyboard focus,
// so Hyprland grants focus when the surface is mapped (opened flips
// to true). That's what makes the SUPER+CTRL+W keybind actually work
// — OnDemand only grants focus on click/hover.
// KeyboardPanel primes layer-shell focus whenever the panel opens. That's
// what makes the SUPER+CTRL+W keybind land here with navigation ready.
onOpenedChanged: {
if (opened) {
refresh(true)
@@ -1054,7 +1052,7 @@ Panel {
// Keyboard-driven popup anchored to the bar widget icon. The shared
// KeyboardPanel handles the layer-shell PanelWindow scaffolding
// (Exclusive focus on map, screen binding, anchored-to-icon positioning,
// (focus priming on open, screen binding, anchored-to-icon positioning,
// outside-click via an overlay MouseArea + Region mask that lets the bar
// remain clickable, fade animation, popout coordination). What stays
// here is the wifi-specific UI inside.