diff --git a/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalConnected.qml b/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalConnected.qml index f50b7d28b..67be72065 100644 --- a/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalConnected.qml +++ b/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalConnected.qml @@ -359,8 +359,10 @@ Item { contentVisible = true; spotlightContent.closeTransientUi?.(); + const targetQuery = query || (SettingsData.rememberLastQuery ? (SessionData.launcherLastQuery || "") : ""); + if (spotlightContent.searchField) { - spotlightContent.searchField.text = query; + spotlightContent.searchField.text = targetQuery; } if (spotlightContent.controller) { var targetMode = mode || SessionData.getLauncherRestoreMode(); @@ -375,8 +377,8 @@ Item { spotlightContent.controller.collapsedSections = {}; spotlightContent.controller.selectedFlatIndex = 0; spotlightContent.controller.selectedItem = null; - if (query) { - spotlightContent.controller.setSearchQuery(query); + if (targetQuery) { + spotlightContent.controller.setSearchQuery(targetQuery); } else { spotlightContent.controller.searchQuery = ""; spotlightContent.controller.performSearch(); @@ -422,8 +424,10 @@ Item { Qt.callLater(() => { root.keyboardActive = true; - if (root.spotlightContent && root.spotlightContent.searchField) + if (root.spotlightContent && root.spotlightContent.searchField) { root.spotlightContent.searchField.forceActiveFocus(); + root.spotlightContent.searchField.selectAll(); + } }); }); } diff --git a/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalSpotlight.qml b/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalSpotlight.qml index 288e65409..62102a1a6 100644 --- a/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalSpotlight.qml +++ b/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalSpotlight.qml @@ -155,7 +155,7 @@ Item { } if (spotlightContent.searchField) { spotlightContent.searchField.forceActiveFocus(); - spotlightContent.searchField.cursorPosition = spotlightContent.searchField.text.length; + spotlightContent.searchField.selectAll(); } } diff --git a/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalStandalone.qml b/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalStandalone.qml index dc54ab420..eeb68c2eb 100644 --- a/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalStandalone.qml +++ b/quickshell/Modals/DankLauncherV2/DankLauncherV2ModalStandalone.qml @@ -139,6 +139,7 @@ Item { if (spotlightContent.searchField) { spotlightContent.searchField.text = targetQuery; + spotlightContent.searchField.selectAll(); } if (spotlightContent.controller) { var targetMode = mode || SessionData.getLauncherRestoreMode();