Close panels on a click outside them

Panels relied on Hyprland sending every click to a layer with exclusive
keyboard focus; it does not, so clicking another window or monitor left
the Control Center, Dashboard, notch, Overview, Settings, wallpaper
picker, launcher and plugin panels open. A shared OutsideClick holds a
Hyprland focus grab while a panel is open and closes it when the grab is
cleared. The bars count as inside, so a bar button still toggles its
panel. The old catchers stay as a fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-26 00:49:19 +01:00
1 parent 476ad75ba4
commit 6ad9c0b17e
10 files changed
+103 -14

No files matched your search

+8 -4
View File
@@ -245,10 +245,14 @@ PanelWindow {
}
}
// Hyprland routes every pointer event to a layer with exclusive keyboard
// focus, so clicks outside the panel arrive here with out-of-bounds
// coordinates. Qt Quick still delivers them to items extending past the
// window, so this catcher (behind the panel) dismisses on outside clicks.
OutsideClick {
window: root
active: ShellState.controlCenterOpen
onOutside: ShellState.controlCenterOpen = false
}
// Fallback for compositors that route every click to a layer with
// exclusive keyboard focus (out-of-bounds coordinates reach items that
// extend past the window); OutsideClick above covers Hyprland.
MouseArea {
objectName: "controlCenterOutside"
x: -20000