Bug 455239

Summary: KRunner does not update search list on 'Enter' fast enough, causes wrong application to launch
Product: [Plasma] krunner Reporter: Knut Andre Tidemann <knut.tidemann>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: CONFIRMED ---    
Severity: normal CC: alex.chiriac2002, ben+kde, christianhein, el, gatorquin, karl, kdebugs, kevinholtkamp26, martyk, plasma-bugs-null, sthenujan2002, tbqdrn
Priority: NOR    
Version First Reported In: 5.24.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Knut Andre Tidemann 2022-06-14 10:38:05 UTC
SUMMARY
If you launch KRunner with alt+f2 and then start typing, the previous search result of the last krunner instance are still shown in the list for the first second or so, even if you begin to type something else. If you are fast typer and write the name of a new application and press 'Enter' it will launch the top result of the last search instead of the new application.

This was tested on X.org with the NVidia proprietary driver 515.48.07.
CPU and memory are AMD Ryzen 9 5900X and 32GB, so it should not be the hardware that's the problem here. This happens even if krunner is 'hot' in memory.

STEPS TO REPRODUCE
1. Start an application through krunner, for example 'kate'.
2. Press alt+f2, then quickly type something else like 'kwrite' and press enter.
3. Notice that 'kate' is now being opened if you did this fast enough, typically in the range of 1-2 seconds.

OBSERVED RESULT
The wrong application is launched, in this case 'kate'.

EXPECTED RESULT
The list should be updated before the applicaiton execution happens, which would result in the correct application launching. In this case 'kwrite'.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version:  5.24.5-2
KDE Frameworks Version: 5.94.0-1
Qt Version: 5.15.4+kde+r146-1
Comment 1 iotku 2023-01-03 01:17:00 UTC
SUMMARY
Similar issue here, there have been multiple instances where I'm intending to open for instance `System Settings` so I type a query into the search box of the Application Launcher such as "settings" and since the first search result provided is actually Firefox (which appears to match against "Web Brow[se]r" in its description) if I hit enter without sufficient (and disruptive) delay `Firefox` will launch instead of `System Settings` which is always the final search result if I deliberately wait. 

An identical issue is observed with JetBrains' GoLand and IDEA products installed where typing "idea" matches with GoLand's description "An [ID]e for Go and Web" first, leading to GoLand launching rather than IntelliJ IDEA.

OBSERVED RESULT
The search maintains the first initial search until typing has stopped for a noticeable amount of time, should enter be pressed prior to said time period passing the old search result will be executed rather than the proper result which would appear afterwards leading to launching an unexpected selection.

Below is a video demonstrating that I can consistently either launch Firefox or System Settings with the same query "settings" depending on if I pause for a short period of time or not before hitting enter.
 
https://www.youtube.com/watch?v=GBPuKh0b95c

EXPECTED RESULT
I would expect that the *final* search result always executes in a consistent manor rather than the old incomplete search result. I would expect that preforming the same search which ultimately yields the same result would launch the same application every time regardless of if I pressed enter prior to the search completing.

SOFTWARE/OS VERSIONS
Distro: Fedora 37
Plasma: 5.26.4
KDE Frameworks: 5.101.0
QT: 5.15.7
Comment 2 Oliver Beard 2025-03-04 01:01:50 UTC
*** Bug 489673 has been marked as a duplicate of this bug. ***
Comment 3 John Kizer 2025-04-05 18:03:07 UTC
*** Bug 491966 has been marked as a duplicate of this bug. ***
Comment 4 John Kizer 2025-04-05 18:03:18 UTC
*** Bug 492234 has been marked as a duplicate of this bug. ***
Comment 5 Christian Hein 2025-06-19 22:17:34 UTC
I was experiencing the same issue and want to share a workaround that worked for me.

WORKAROUND
I've disabled the "Software Center" plugin in the Plasma Search settings. This reduces the search delay after typing a character from ~250ms to ~60ms. I've kept all other plugins activated. Works both in Application Launcher and KRunner (Alt+F2). With this much shorter delay I practically never launch the wrong program. (Still possible though if I try deliberately.)

I tested this by first typing "fire" in the Application Launcher, waiting, then typing "w" to see how quickly the selected search result switches from "Firefox" to "Firewall". I measured time using a screen recording.

Unfortunately, this probably won't completely fix the issue for those who were already experiencing much larger delays (1-2s).

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.1
Kernel Version: 6.15.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 6 Ellie 2025-06-19 22:21:09 UTC
It seems to me like it might be a conceptual problem of making krunner show a list gradually with multiple updates. Perhaps KRunner should never show any results until all results are loaded, and only then show a predictable list of results. If enter is pressed earlier, it should probably delay processing it until the predictable final results are available, and only then try to launch what the top selection on that final list is. I can't think of a different stable approach to solve this.
Comment 7 Kevin 2025-07-06 21:16:48 UTC
I am having the same issue, unfortunately disabling software center result did not fix it for me.

When I want to get into system settings, I hit super, type "set" and hit enter. When I do this fast enough (but still in the correct order) it opens "SELinux Troubleshooter", because it has not updated the search after I hit "t"

When you hit enter, it seems like it just uses the top result, even if it has not refreshed after typing more.
Comment 8 benjamin melançon 2025-09-30 04:29:29 UTC
One solution would be to leave results in the order in which they are loaded, rather than sorting them into groups.  I would happily take an option to enable that compromise rather than the frustration of the item you are looking at moving and a different one opening in the split-second it takes to press Enter.

(Application Launcher search — the one available in the dock's main menu, same might say 'start' menu — seems slower than KRunner via alt+F2.  Disabling Software Center does seem to help.)