Bug 254365 - krunner sometimes neglects the enter key pressed by the use
Summary: krunner sometimes neglects the enter key pressed by the use
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-16 13:38 UTC by John van Spaandonk
Modified: 2013-01-17 12:02 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John van Spaandonk 2010-10-16 13:38:00 UTC
Version:           4.5 (using KDE 4.5.2) 
OS:                Linux

This is a regression introduced with kde 4.5
I am not the only one noticing this, it is marked on a blog somwehere. Can't
find it anymore. Anyhow should be extremely simple to reproduce.

Reproducible: Sometimes

Steps to Reproduce:
press alt-f2
enter a command
press <enter>

Actual Results:  
sometimes I have to press <enter> twice because krunner apparently neglects or misses my first enter.

Expected Results:  
I expect krunner to always react to key presses.
It always did so before kde 4.5.
Comment 1 John Layt 2010-10-20 00:17:26 UTC
I did have this problem, it only seemed to happen when the text I entered matched the auto-complete text I had entered previously.  However, in an openSuse update about 2 weeks ago the problem stopped, so this might be fixed.
Comment 2 Terényi, Balázs 2010-10-21 09:35:05 UTC
The same problem here since 4.5. Very annoying!
I can reproduce it every time: Type anything fast, for example "firefox" and press enter. Nothing happens, but if you wait for displaying the results for the string and you press enter afterwars it works. Or you have to press enter twice, it works too.
Thanks in advance!
Comment 3 Terényi, Balázs 2010-10-21 09:37:20 UTC
I'm using OpenSuSE 11.3 with the latest KDE (4.5.2) and the problem still exists here.
Comment 4 Zane Tu 2010-10-21 21:33:37 UTC
Similar problem. It didn't occur until several days ago (probably after a Kubuntu update). To me the problem appeared to be a seemingly unnecessary short delay (about one second) before list of candidate applications is shown and "enter" can be recognized and accepted by krunner. At first I thought the cause was that I enabled too many plugins for krunner and thus it took longer for krunner to search against its cache. Therefore I disabled all plugins except "Applications". But that didn't work. It was not until then that I began to suspect that this might actually be a newly introduced bug. 

I wonder if this bug can be fixed by caching keyboard input (especially the terminating "enter") for a second or two so that users who type fast to launch their favorite applications don't have to wait for the list of candidate applications to appear. 

By the way, I'm using KDE v4.5.1 on Kubuntu 10.10 (amd64).
Comment 5 Zane Tu 2010-10-21 21:47:21 UTC
Hi John van Spaandonk, 

Is the following blog article what you are referring to? 
http://aseigo.blogspot.com/2010/02/krunner-responsiveness.html
Comment 6 John van Spaandonk 2010-12-06 07:31:32 UTC
@Zane Tu: No this is not the blog post. I cannot find it anymore, but it was a review of kde 4.5 and mentioned the problem with krunnen (alt-F2 / run command) sometimes missing the enter key after a command was pressed. The post from Aaron
is about something else: krunner waiting too long to appear after pressing alt-f2.

Observation:
Looks like if I wait after typing until krunner shows the selection the problem does not occur. In other words, krunner is busy with its internal processing and therefore misses my keystroke [enter]. But for me the usefulness decreases if I have to explicitely wait after typing something.

It would be nice if Aaron could repair it. I guess it would help if
the developers use really old hardware / limited memory etc. to test. 
This could be an error that typically does not show when you have fast hardware.
Comment 7 Terényi, Balázs 2010-12-06 09:21:37 UTC
I have fast hardware with 4G RAM, and the problem is still here.
The results appear instantly (before I finish typing "firefox") but I have to wait some time (~500ms) to get the Enter caught.
Comment 8 John Layt 2010-12-06 11:39:23 UTC
Strange that you still get the bug when it's long since disappeared on my openSuse 11.3 install (currently on KDE 4.5.4).  

Could we get a quick survey on distro version and KDE version?  

I suspect that it may be a config problem rather than a code bug, could you try creating a brand new user and log in with that user to see if they have the problem?

Also has anyone tested my theory about the auto-complete text?
Comment 9 John van Spaandonk 2010-12-06 11:53:42 UTC
My hardware:

Pentium IV-2.6 GHZ
1GB RAM
Asus P4P800 PRO motherboard
ATI Radeon 9600SE
Using up-to-date Arch linux, with newest mesa, ATI mesa driver etc.

Never had this problem in KDE 4.5, so for me it is a clear regression.
Perhaps having todo with the mentioned changes by aseigo
Comment 10 John van Spaandonk 2010-12-06 11:54:41 UTC
I meant to say: never had this problem _before_ kde 4.5
Comment 11 Terényi, Balázs 2010-12-06 13:50:49 UTC
As I could try it has nothing to do with auto-completion.

It works like a charm with a newly created user. So I compared the newly created and my old krunnerrc, but didn't found anything useful.

I deleted my krunnerrc and it works now. Let's see if it's really gone.
Comment 12 Zane Tu 2010-12-07 07:05:08 UTC
Hi all, 
I seem to have pinpointed the root cause. The problem is probably due to a much too long command history, which is recorded in lines starting with "PastQueries=" and "LaunchCounts=" in ~/.kde/share/config/krunnerrc. 
After killing all "krunner" processes, deleting the two lines mentioned above, logging out, and logging in again, krunner began honoring the terminating "enter" key promptly. 
By the way, I didn't have this problem before kde 4.5, even with a long command history.
Comment 13 John Layt 2010-12-07 10:52:38 UTC
Zane, excellent detective work!  I knew it was something to do with the history completion, hopefully that's enough info now for someone to track the problem down.
Comment 14 John van Spaandonk 2010-12-08 19:44:20 UTC
On Tue,  7 Dec 2010 10:52:40 +0100 (CET), John Layt <john@layt.net> wrote:
> https://bugs.kde.org/show_bug.cgi?id=254365
> 
> 
> John Layt <john@layt.net> changed:
> 
>            What    |Removed                     |Added
>
----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |NEW
>      Ever Confirmed|0                           |1
> 
> 
> 
> 
> --- Comment #13 from John Layt <john layt net>  2010-12-07 10:52:38 ---
> Zane, excellent detective work!  I knew it was something to do with the
> history
> completion, hopefully that's enough info now for someone to track the
> problem
> down.
> 
> -- 
> Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.

 
Zane, also from my side congratulations.
I can confirm this solves the problem. Presumably temporarily, until
the list becomes too large again.
Let's hope somebody will solve this regression before kde 4.6...
Comment 15 Joan Rieu 2011-06-11 13:01:40 UTC
I found out that the "PastQueries" line was the real culprit: the other, "LaunchCounts", is used by Plasma's RunnerContext but it does not slow down KRunner's search (maybe it makes launching slower... I don't know).

The LaunchCount can easily be cleared by a D-Bus command. In fact, the cleaning methods are all ready for use, but they are never called anywhere !

The D-Bus command is:
qdbus org.kde.krunner /MainApplication clearHistory

That might be something to run on session start, it just depends on how much you use the history... Better would be to restrict the size of the list, so that only a recent history is kept.

I'll see if I can do it.
Comment 16 Joan Rieu 2011-06-11 13:44:30 UTC
It turns out there might already be a limit of 50 history items (the oldest entry gets removed when a new one is added), but I cannot find where that limit is set in KRunner's source code. The bug would probably be fixed by setting it to 5 or 10, which should be fine.
Comment 17 Aaron J. Seigo 2013-01-16 15:20:48 UTC
commit 3894923 in KDE/4.10 and master branches of kde-workspace.