From 2dbfec030755e11b1b43bbcb5a20597f1853deef Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 20 Nov 2025 13:56:35 -0500 Subject: [PATCH] niri: close spotlight when closing overview --- quickshell/Modals/Spotlight/SpotlightModal.qml | 3 +++ .../Modules/WorkspaceOverlays/NiriOverviewOverlay.qml | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/quickshell/Modals/Spotlight/SpotlightModal.qml b/quickshell/Modals/Spotlight/SpotlightModal.qml index 34ed7b47..9b5036b2 100644 --- a/quickshell/Modals/Spotlight/SpotlightModal.qml +++ b/quickshell/Modals/Spotlight/SpotlightModal.qml @@ -22,8 +22,10 @@ DankModal { property bool spotlightOpen: false property alias spotlightContent: spotlightContentInstance + property bool openedFromOverview: false function show() { + openedFromOverview = false spotlightOpen = true open() @@ -55,6 +57,7 @@ DankModal { } function hide() { + openedFromOverview = false spotlightOpen = false close() } diff --git a/quickshell/Modules/WorkspaceOverlays/NiriOverviewOverlay.qml b/quickshell/Modules/WorkspaceOverlays/NiriOverviewOverlay.qml index 75f362bd..d4c473b1 100644 --- a/quickshell/Modules/WorkspaceOverlays/NiriOverviewOverlay.qml +++ b/quickshell/Modules/WorkspaceOverlays/NiriOverviewOverlay.qml @@ -11,6 +11,15 @@ Scope { // Only show overlay when in overview and spotlight is not open property bool overlayActive: NiriService.inOverview && !(PopoutService.spotlightModal?.spotlightOpen ?? false) + Connections { + target: NiriService + function onInOverviewChanged() { + if (!NiriService.inOverview && PopoutService.spotlightModal?.openedFromOverview) { + PopoutService.spotlightModal.hide() + } + } + } + Loader { id: niriOverlayLoader active: NiriService.inOverview @@ -93,6 +102,7 @@ Scope { Qt.callLater(() => { if (PopoutService.spotlightModal) { if (event.text) { + PopoutService.spotlightModal.openedFromOverview = true PopoutService.spotlightModal.showWithQuery(event.text.trim()) } }