Bug 299472 - "Arrow down" key works incorrectly in krunner
Summary: "Arrow down" key works incorrectly in krunner
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 222266 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-05 23:16 UTC by Kyrylo Bohdanenko
Modified: 2015-02-04 17:24 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
quick workaround (1.16 KB, patch)
2014-04-29 20:45 UTC, Renato Atilio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kyrylo Bohdanenko 2012-05-05 23:16:40 UTC
When pressing "arrow down" key after search in krunner nothing happens, as like it tries to go down by history, but there's nothing as the entered query was the last one.

For example I've executed firefox five minutes before via krunner, and now I'm trying to open Kate Session Manager. When I type 'kate' into krunner it shows me a list of 3 actions with first one selected, but when I press "Arrow Down" on keyboard it does not switches to next action.
But when I press "Arrow Up" it changes query to 'firefox'. And then, if I press "Arrow Down" two times - krunner switches to 'kate' query on first tap and to second action on second tap (as it should do on the very beginning)

Reproducible: Always

Steps to Reproduce:
1. Open krunner
2. type 'kate'
3. press "Arrow Down" on keyboard
Actual Results:  
Nothing happens

Expected Results:  
Second action in list should be selected
Comment 1 Kyrylo Bohdanenko 2012-05-06 12:38:18 UTC
It looks like the bug isn't always reproducible. But it happens sometimes when you're manipulating krunner with arrow keys.
Comment 2 Kyrylo Bohdanenko 2012-05-06 12:43:05 UTC
But I've found kind of a way to reproduce it:
1) open krunner
2) place mouse cursor over the input field
3) type 'kate'
4) press 'arrow down' and 'arrow up', so the input field regains focus
5) press 'arrow down'
6) nothing happens

I will investigate further
Comment 3 Aleh 2013-04-08 16:35:51 UTC
Same, but can't reproduce always.
KDE 4.10.2 openSUSE 12.3
Comment 4 Panurge 2013-11-13 03:52:56 UTC
I have tried a few distributions to see if I could get rid of this bug, but I've had this on every distribution I've used (with KDE from 4.8.x to 4.11.x) :

Kubuntu 12.04, 12.10, 13.04, 13.10
Debian 7.2
OpenSUSE 12.3, 13.1 RC2

I can't "reproduce" it since krunner just seems to stop working as expected out of the blue, but I can confirm it always does happen after some time logged in.

Here are a few facts I was able to notice, though :

When this bug occurs, pressing up arrow key once shows previous search, then pressing down again takes you back to first input, and from there it is once again possible to navigate through search results. You have to do this for every search (that is : type something, press up, press down, navigate) . 

This does not affect the task oriented krunner.

When, and only when this bug occurs, Lancelot starts acting weird too : you can navigate through its search results with keyboard arrows but after navigating through a few results, individual results are no longer highlighted, but the bold font remains. 
I don't think that's a very clear explaination of what happens, but I can provide screenshots if needed. 
Seeing how these 2 bugs always occur together,  I think it's safe to assume they have a common cause.
Comment 5 Konstantin 2014-04-18 09:16:02 UTC
Mint KDE 16
KDE 4.11.5
This bug affects me too. Just after loading all ok, but after some period of time I'm not able to use down key to navigate between search results. Temporary workarountd is to use Tab instead Down key.
Comment 6 Renato Atilio 2014-04-24 15:31:49 UTC
I can confirm it for KDE 4.13.0 on Kubuntu 14.04.

In my opinion this bug should be marked as a duplicate of bug 222266 , or vice versa.
Comment 7 Renato Atilio 2014-04-29 20:45:29 UTC
Created attachment 86353 [details]
quick workaround

Debugging this situation, I've noticed that every time this bug happened, m_searchTerm->currentIndex() on interfaces/default/interface.cpp:247 was something random (sometimes 20, sometimes 2, sometimes 19). It was index 1 before pressing the down key and going to the result scene, but after pressing the up key and re-focusing the history combo box, the index was something else.

The same situation happened sometimes on new searches - just Alt+F2, type something and press the down key, nothing happens because the currentIndex() is wrong.

The workaround on the patch is just a guarantee that the index is correct: on every focus in event on krunnerhistorycombobox, we reset the index while keeping the search term as before and the result scene open.

This patch was created using the "kde-workspace" repository on branch "KDE/4.11", because I couldn't find any newer branch there. The "krunner" repository needs KF5 and the "krunner" directory on "plasma-workspace" repository I don't know what is.

Is this something suitable for a review request?
Comment 8 Christoph Feck 2014-05-09 19:19:14 UTC
*** Bug 222266 has been marked as a duplicate of this bug. ***
Comment 9 Vishesh Handa 2015-02-04 17:24:46 UTC
Fixed with Plasma 5.