Bug 169283

Summary: Fast typing will load wrong application
Product: [Plasma] krunner Reporter: Richard Hartmann <richih-kde>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: dev, greg_g, gronslet, kdebugs.20.orzelf, leo, mail, sylvain.joyeux, walch.martin, wilderkde
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Richard Hartmann 2008-08-17 01:41:40 UTC
Version:           unknown (using 4.1.00 (KDE 4.1.0), Debian packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.26-1-686

When typing really fast, it seems as if the enter key is evaluated before the program matching is done.

When typing kpat<CR>, I start kontact or kpackage, depending on how fast I type.
Comment 1 Jakub Grandys 2008-08-17 12:26:08 UTC
Same here (4.1 on ArchLinux), depending on speed for example typing "oper" opens Opera or OpenOffice (if slower). It's annoying.
Comment 2 Marcel Schaal 2008-09-23 17:31:50 UTC
this behaviour is also available on kubuntu intrepid alpha 6. 
Comment 3 Leo Spalteholz 2008-10-14 19:43:22 UTC
Even typing the full command of an app does not work if you type too fast.  For example if I type "kdesvn"+enter quickly, krunner will launch KAppTemplate.  If I slow down, it launches kdesvn.  This is a critical bug for a keyboard launcher where the whole point is to be quick and predictable.
Comment 4 Richard Hartmann 2008-10-15 11:29:45 UTC
Critical might be a tad too much, but I would agree that it is major. That is up to the devs, though.

Is anyone actually working on/looking at this?
Comment 5 Richard Hartmann 2008-10-15 11:32:19 UTC
This seems to be related to http://bugs.kde.org/show_bug.cgi?id=154228 and might need to be merged.
Comment 6 FiNeX 2008-11-30 17:45:57 UTC
*** Bug 175110 has been marked as a duplicate of this bug. ***
Comment 7 FiNeX 2008-12-20 21:03:58 UTC
*** Bug 173598 has been marked as a duplicate of this bug. ***
Comment 8 Thomas Capricelli 2009-02-03 00:31:57 UTC
dont know if that's it but quite often when i type something (ex "gg:bla"), then the window that pops up (if ever) is the result from another "gg:*" i tried few days ago. really weird.

reproduced from 4.1 to 4.2 through most of 4.2 betas
Comment 9 Jacopo De Simoi 2009-02-21 06:05:49 UTC
I believe that this bug, and possibly #170032 are caused by the following situation:

In the code there's a locking mechanism to prevent running matches which refer to previous queries; namely, before running the default item, the variable m_queryRunning is checked to see if there's a pending query we need to wait for;

       if (m_queryRunning) {
    m_delayedRun = true;
    } else {
  // do something }

m_queryRunning is set to true each time a query is /launched/ (i.e. each time we add a letter to the search term) and set back to false each time the query returns some non-trivial result. 
So here's what I believe it happens. I take as an example typing "system settings" because that's how I can reproduce the bug:

A bunch of items are obtained by querying for "system". It takes a relatively long time to find all the items; in particular the nepomuk search is quite late. Suppose I manage to type "system settings" before the first matches are even retrieved; as soon as they are received m_queryRunning will be set to false and the lock is gone, even if the query for "system settings" is still running. Whenever I hit enter, then I'm going to run the first result for "system", in my case it's the sweeper. 

The lock with a bool (m_queryRunning) is very fragile, a counter would be better; unfortunately a single query may end up in one, many or no calls to matchCountChanged, so it's not the right way to keep track of pending queries.

Does it make any sense?
--J
Comment 10 Thomas Capricelli 2009-03-08 23:50:17 UTC
for me, it still happens in 4.2.1
Comment 11 Jacopo De Simoi 2009-04-05 12:40:27 UTC
Please confirm this is still present with 4.2.2
Comment 12 Martin Walch 2009-04-05 12:58:50 UTC
Works perfectly now in krunner.
Comment 13 Leo Spalteholz 2009-04-24 00:08:26 UTC
This bug seems fixed in 4.2.2 here as well.  Thanks!
Comment 14 Thomas Capricelli 2009-05-07 18:30:45 UTC
seems fixed in 4.2.3, thanks.
Comment 15 Jacopo De Simoi 2009-05-08 22:09:39 UTC
Closing then! 
It should have been fixed in 4.2.2 and no negative reports since then.  

Thanks all for feedback