diff --git a/shell/plugins/launcher/Launcher.qml b/shell/plugins/launcher/Launcher.qml index a724a3d8..14fbaf50 100644 --- a/shell/plugins/launcher/Launcher.qml +++ b/shell/plugins/launcher/Launcher.qml @@ -233,12 +233,14 @@ Item { root.filterText = nextFilter root.selectedIndex = 0 root.cursorActive = true + root.hoverArmed = false root.rebuildDisplay() } function select(delta) { if (displayModel.count === 0) return root.cursorActive = true + root.hoverArmed = false root.selectedIndex = (root.selectedIndex + delta + displayModel.count) % displayModel.count resultList.positionViewAtIndex(root.selectedIndex, ListView.Contain) } @@ -456,6 +458,7 @@ Item { } else if (event.key === Qt.Key_Home) { if (displayModel.count > 0) { root.cursorActive = true + root.hoverArmed = false root.selectedIndex = 0 resultList.positionViewAtIndex(root.selectedIndex, ListView.Contain) } @@ -463,6 +466,7 @@ Item { } else if (event.key === Qt.Key_End) { if (displayModel.count > 0) { root.cursorActive = true + root.hoverArmed = false root.selectedIndex = displayModel.count - 1 resultList.positionViewAtIndex(root.selectedIndex, ListView.Contain) } diff --git a/test/shell.d/launcher-search-test.sh b/test/shell.d/launcher-search-test.sh index cf781a2b..13d41c49 100644 --- a/test/shell.d/launcher-search-test.sh +++ b/test/shell.d/launcher-search-test.sh @@ -68,6 +68,11 @@ assertEqual(acronymMatches[0], 'Google Contacts', 'short acronym matching still const directMatches = search.sortedEntries(entries, 'obs').map(row => search.entryName(row.entry)) assertEqual(directMatches[0], 'OBS Studio', 'direct app-name matching still works') +assert( + /function select\(delta\)[\s\S]*root\.hoverArmed = false[\s\S]*root\.selectedIndex =/.test(launcherQml), + 'launcher keyboard navigation disarms stale hover before moving selection' +) + const confirmDeleteMatch = launcherQml.match(/function confirmDelete\(\) \{([\s\S]*?)\n \}/) assert(confirmDeleteMatch, 'launcher confirmDelete function exists') assert(