From 879533440e57118d9400d75da7796f2553ff32dc Mon Sep 17 00:00:00 2001 From: Marlon Kranz Date: Thu, 15 Oct 2026 15:13:15 +0200 Subject: [PATCH] fix(island): close a focused island with one outside click (#3792) On Hyprland, an island holding keyboard focus runs a focus grab that only whitelisted the bar window. The full-screen dismiss layer wasn't on the list, so the first click outside only ended the grab and the card needed a second click to close. That hit every card that takes keyboard focus (weather right away, media after a click inside). Add the dismiss layer to the grab, the way DPopout whitelists its background window. --- quickshell/Modules/DIsland/DIslandHostWindow.qml | 8 ++++++++ quickshell/Modules/DIsland/IslandBarHost.qml | 1 + quickshell/Modules/DIsland/IslandHostChrome.qml | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/quickshell/Modules/DIsland/DIslandHostWindow.qml b/quickshell/Modules/DIsland/DIslandHostWindow.qml index 415c19737..ac1c126d2 100644 --- a/quickshell/Modules/DIsland/DIslandHostWindow.qml +++ b/quickshell/Modules/DIsland/DIslandHostWindow.qml @@ -28,6 +28,14 @@ Item { return root.body?.containsGlobalPoint(gx, gy, padding) ?? false; } + // The focus grab must include the dismiss layer, or Hyprland eats the first outside click to end the grab. + Binding { + target: root.body + property: "dismissWindow" + value: dismissWindow + when: !!root.body + } + PanelWindow { id: dismissWindow diff --git a/quickshell/Modules/DIsland/IslandBarHost.qml b/quickshell/Modules/DIsland/IslandBarHost.qml index cfb9db4d1..5c3243252 100644 --- a/quickshell/Modules/DIsland/IslandBarHost.qml +++ b/quickshell/Modules/DIsland/IslandBarHost.qml @@ -177,6 +177,7 @@ Item { readonly property int keyboardFocusPolicy: KeyboardFocus.keyboardFocus(controller.keyboardDismissRequested && root.keyboardFocusArmed && !controller.keyboardYielded, null) readonly property bool wantsFocusGrab: KeyboardFocus.wantsGrab(controller.keyboardDismissRequested && !controller.keyboardYielded, null) readonly property var transientFocusWindows: islandTransientSurfaces.focusWindows + property var dismissWindow: null readonly property string registryKey: IslandHostRegistry.key(root.screen?.name, root.barId) property string registeredKey: "" diff --git a/quickshell/Modules/DIsland/IslandHostChrome.qml b/quickshell/Modules/DIsland/IslandHostChrome.qml index 6f7e12108..646346d6d 100644 --- a/quickshell/Modules/DIsland/IslandHostChrome.qml +++ b/quickshell/Modules/DIsland/IslandHostChrome.qml @@ -14,6 +14,6 @@ DFocusGrab { readonly property var maskItem: root.host && !root.host.inputSuspended ? root.host.inputMaskItem : null readonly property var fittsStripItem: root.host && !root.host.inputSuspended ? root.host.fittsStripItem : null - windows: [root.window].concat(root.extraWindows, root.host?.transientFocusWindows ?? []) + windows: [root.window].concat(root.extraWindows, root.host?.dismissWindow ?? [], root.host?.transientFocusWindows ?? []) wanted: root.host?.wantsFocusGrab ?? false }