From eb04ab7dcade5371caa0fd3057660dcdb74e0730 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 | 32 ++++++------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml b/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml index 9e60ff36..0b0af1e1 100644 --- a/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml +++ b/quickshell/Modals/DankLauncherV2/DankLauncherV2Modal.qml @@ -1,5 +1,4 @@ import QtQuick -import QtQuick.Effects import Quickshell import Quickshell.Wayland import Quickshell.Hyprland @@ -17,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: "" @@ -267,38 +265,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