From dbf132d63395c18d4c84378c639f39afe83e10f8 Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 17 Mar 2026 20:31:55 -0400 Subject: [PATCH] launcher v2: simplify screen change bindings --- .../DankLauncherV2/DankLauncherV2Modal.qml | 31 ++++++------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml b/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml index 2362de78..94025837 100644 --- a/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml +++ b/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml @@ -16,7 +16,6 @@ Item { property var spotlightContent: launcherContentLoader.item property bool openedFromOverview: false property bool isClosing: false - property bool _windowEnabled: true property bool _pendingInitialize: false property string _pendingQuery: "" property string _pendingMode: "" @@ -262,38 +261,26 @@ Item { if (Quickshell.screens.length === 0) return; - const screen = launcherWindow.screen; - const screenName = screen?.name; - - let needsReset = !screen || !screenName; - if (!needsReset) { - needsReset = true; + const screenName = launcherWindow.screen?.name; + if (screenName) { for (let i = 0; i < Quickshell.screens.length; i++) { - if (Quickshell.screens[i].name === screenName) { - needsReset = false; - break; - } + if (Quickshell.screens[i].name === screenName) + return; } } - if (!needsReset) - return; + if (spotlightOpen) + hide(); const newScreen = CompositorService.getFocusedScreen() ?? Quickshell.screens[0]; - if (!newScreen) - return; - - root._windowEnabled = false; - launcherWindow.screen = newScreen; - Qt.callLater(() => { - root._windowEnabled = true; - }); + if (newScreen) + launcherWindow.screen = newScreen; } } PanelWindow { id: launcherWindow - visible: root._windowEnabled && (spotlightOpen || isClosing) + visible: spotlightOpen || isClosing color: "transparent" exclusionMode: ExclusionMode.Ignore