diff --git a/quickshell/bar/Bar.qml b/quickshell/bar/Bar.qml index 00fe43e..5fb3b8a 100644 --- a/quickshell/bar/Bar.qml +++ b/quickshell/bar/Bar.qml @@ -38,10 +38,24 @@ PanelWindow { // a click anywhere else closes it. readonly property bool searching: notch && ShellState.notchSearch && ScreenService.current(ShellState.launcherScreen) === screen WlrLayershell.keyboardFocus: searching ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None + // The grab starts once the bar holds the keyboard; started together with + // the focus change, Hyprland clears it at once and the search closes. + property bool grabbing: false + onSearchingChanged: { + grabbing = false; + if (searching) + grabStart.restart(); + } + Timer { + id: grabStart + interval: 150 + onTriggered: root.grabbing = root.searching + } HyprlandFocusGrab { windows: [root] - active: root.searching - onCleared: ShellState.launcherOpen = false + active: root.grabbing + onCleared: if (root.grabbing) + ShellState.launcherOpen = false } Component.onCompleted: TrayService.registerBar(root) Component.onDestruction: TrayService.unregisterBar(root)