From d7b39634e6978b6a0ffafa5ce3b77322a3fbd818 Mon Sep 17 00:00:00 2001 From: bbedward Date: Wed, 26 Nov 2025 12:46:19 -0500 Subject: [PATCH] hyprland: fix focus grab --- quickshell/Modals/BluetoothPairingModal.qml | 2 +- quickshell/Modals/Clipboard/ClipboardHistoryModal.qml | 2 +- quickshell/Modals/Common/DankModal.qml | 2 ++ quickshell/Modals/DankColorPickerModal.qml | 2 +- quickshell/Modals/NotificationModal.qml | 2 +- quickshell/Modals/PolkitAuthModal.qml | 2 +- quickshell/Modals/PowerMenuModal.qml | 2 +- quickshell/Modals/Spotlight/SpotlightModal.qml | 2 +- quickshell/Modals/WifiPasswordModal.qml | 2 +- 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/quickshell/Modals/BluetoothPairingModal.qml b/quickshell/Modals/BluetoothPairingModal.qml index 8c93626f..dab5310d 100644 --- a/quickshell/Modals/BluetoothPairingModal.qml +++ b/quickshell/Modals/BluetoothPairingModal.qml @@ -11,7 +11,7 @@ DankModal { layerNamespace: "dms:bluetooth-pairing" HyprlandFocusGrab { - windows: [root] + windows: [root.contentWindow] active: CompositorService.isHyprland && root.shouldHaveFocus } diff --git a/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml b/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml index f8f95e5a..74a773bc 100644 --- a/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml +++ b/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml @@ -14,7 +14,7 @@ DankModal { layerNamespace: "dms:clipboard" HyprlandFocusGrab { - windows: [clipboardHistoryModal] + windows: [clipboardHistoryModal.contentWindow] active: CompositorService.isHyprland && clipboardHistoryModal.shouldHaveFocus } diff --git a/quickshell/Modals/Common/DankModal.qml b/quickshell/Modals/Common/DankModal.qml index 47168cf3..e34ef557 100644 --- a/quickshell/Modals/Common/DankModal.qml +++ b/quickshell/Modals/Common/DankModal.qml @@ -44,6 +44,8 @@ Item { property bool keepContentLoaded: false property bool keepPopoutsOpen: false property var customKeyboardFocus: null + readonly property alias contentWindow: contentWindow + readonly property alias backgroundWindow: backgroundWindow signal opened signal dialogClosed diff --git a/quickshell/Modals/DankColorPickerModal.qml b/quickshell/Modals/DankColorPickerModal.qml index 7edc382a..f57e5a8d 100644 --- a/quickshell/Modals/DankColorPickerModal.qml +++ b/quickshell/Modals/DankColorPickerModal.qml @@ -12,7 +12,7 @@ DankModal { layerNamespace: "dms:color-picker" HyprlandFocusGrab { - windows: [root] + windows: [root.contentWindow] active: CompositorService.isHyprland && root.shouldHaveFocus } diff --git a/quickshell/Modals/NotificationModal.qml b/quickshell/Modals/NotificationModal.qml index 8aff74e0..1d0b51a2 100644 --- a/quickshell/Modals/NotificationModal.qml +++ b/quickshell/Modals/NotificationModal.qml @@ -12,7 +12,7 @@ DankModal { layerNamespace: "dms:notification-center-modal" HyprlandFocusGrab { - windows: [notificationModal] + windows: [notificationModal.contentWindow] active: CompositorService.isHyprland && notificationModal.shouldHaveFocus } diff --git a/quickshell/Modals/PolkitAuthModal.qml b/quickshell/Modals/PolkitAuthModal.qml index 6189a8ba..5c2e4be9 100644 --- a/quickshell/Modals/PolkitAuthModal.qml +++ b/quickshell/Modals/PolkitAuthModal.qml @@ -11,7 +11,7 @@ DankModal { layerNamespace: "dms:polkit" HyprlandFocusGrab { - windows: [root] + windows: [root.contentWindow] active: CompositorService.isHyprland && root.shouldHaveFocus } diff --git a/quickshell/Modals/PowerMenuModal.qml b/quickshell/Modals/PowerMenuModal.qml index 63860c4e..d92dabc5 100644 --- a/quickshell/Modals/PowerMenuModal.qml +++ b/quickshell/Modals/PowerMenuModal.qml @@ -14,7 +14,7 @@ DankModal { keepPopoutsOpen: true HyprlandFocusGrab { - windows: [root] + windows: [root.contentWindow] active: CompositorService.isHyprland && root.shouldHaveFocus } diff --git a/quickshell/Modals/Spotlight/SpotlightModal.qml b/quickshell/Modals/Spotlight/SpotlightModal.qml index ec21f07d..ad28adf0 100644 --- a/quickshell/Modals/Spotlight/SpotlightModal.qml +++ b/quickshell/Modals/Spotlight/SpotlightModal.qml @@ -11,7 +11,7 @@ DankModal { layerNamespace: "dms:spotlight" HyprlandFocusGrab { - windows: [spotlightModal] + windows: [spotlightModal.contentWindow] active: CompositorService.isHyprland && spotlightModal.shouldHaveFocus } diff --git a/quickshell/Modals/WifiPasswordModal.qml b/quickshell/Modals/WifiPasswordModal.qml index 702e6c49..92b942e5 100644 --- a/quickshell/Modals/WifiPasswordModal.qml +++ b/quickshell/Modals/WifiPasswordModal.qml @@ -12,7 +12,7 @@ DankModal { keepPopoutsOpen: true HyprlandFocusGrab { - windows: [root] + windows: [root.contentWindow] active: CompositorService.isHyprland && root.shouldHaveFocus }