mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-26 13:07:49 -04:00
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.
This commit is contained in:
1 parent
0f33c4b830
commit
879533440e
3 files changed
+10
-1
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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: ""
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user