From a35fe507f2138b32d9e6bfaeb22193e0b7593161 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 14 May 2025 21:17:56 +0200 Subject: [PATCH] quickshell: fix click-outside-to-close on hyprland 0.49 --- .../quickshell/modules/overview/Overview.qml | 2 +- .../quickshell/modules/session/Session.qml | 25 ------------------- .../modules/sidebarLeft/SidebarLeft.qml | 3 ++- .../modules/sidebarRight/SidebarRight.qml | 3 ++- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/.config/quickshell/modules/overview/Overview.qml b/.config/quickshell/modules/overview/Overview.qml index ec6875833..f0f4b32ff 100644 --- a/.config/quickshell/modules/overview/Overview.qml +++ b/.config/quickshell/modules/overview/Overview.qml @@ -27,7 +27,7 @@ Scope { WlrLayershell.namespace: "quickshell:overview" WlrLayershell.layer: WlrLayer.Overlay - WlrLayershell.keyboardFocus: GlobalStates.overviewOpen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None + WlrLayershell.keyboardFocus: GlobalStates.overviewOpen ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None color: "transparent" mask: Region { diff --git a/.config/quickshell/modules/session/Session.qml b/.config/quickshell/modules/session/Session.qml index b0db8cc95..b8a667408 100644 --- a/.config/quickshell/modules/session/Session.qml +++ b/.config/quickshell/modules/session/Session.qml @@ -40,31 +40,6 @@ Scope { implicitWidth: modelData.width implicitHeight: modelData.height - HyprlandFocusGrab { - id: grab - windows: [ sessionRoot ] - active: false - onCleared: () => { - if (!active) sessionRoot.visible = false - } - } - - Connections { - target: sessionRoot - function onVisibleChanged() { - delayedGrabTimer.start() - } - } - - Timer { - id: delayedGrabTimer - interval: ConfigOptions.hacks.arbitraryRaceConditionDelay - repeat: false - onTriggered: { - grab.active = sessionRoot.visible - } - } - MouseArea { id: sessionMouseArea anchors.fill: parent diff --git a/.config/quickshell/modules/sidebarLeft/SidebarLeft.qml b/.config/quickshell/modules/sidebarLeft/SidebarLeft.qml index 9a5231221..b6eb13bea 100644 --- a/.config/quickshell/modules/sidebarLeft/SidebarLeft.qml +++ b/.config/quickshell/modules/sidebarLeft/SidebarLeft.qml @@ -39,7 +39,8 @@ Scope { // Scope exclusiveZone: 0 implicitWidth: Appearance.sizes.sidebarWidthExtended WlrLayershell.namespace: "quickshell:sidebarLeft" - WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive + // Hyprland 0.49: Focus is always exclusive and setting this breaks mouse focus grab + // WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive color: "transparent" anchors { diff --git a/.config/quickshell/modules/sidebarRight/SidebarRight.qml b/.config/quickshell/modules/sidebarRight/SidebarRight.qml index b7892f3c2..11aae1d93 100644 --- a/.config/quickshell/modules/sidebarRight/SidebarRight.qml +++ b/.config/quickshell/modules/sidebarRight/SidebarRight.qml @@ -36,7 +36,8 @@ Scope { exclusiveZone: 0 implicitWidth: sidebarWidth WlrLayershell.namespace: "quickshell:sidebarRight" - WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive + // Hyprland 0.49: Focus is always exclusive and setting this breaks mouse focus grab + // WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive color: "transparent" anchors {