Bug 499971

Summary: Enter in Menu does not start selected application
Product: [Plasma] plasmashell Reporter: hendrikloewe3
Component: Application Menu (Kicker) widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: cwo.kde
Priority: NOR    
Version First Reported In: git-stable-Plasma/6.3   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.3.2
Sentry Crash Report:
Attachments: Reproduction video of this bug

Description hendrikloewe3 2025-02-13 09:58:16 UTC
Created attachment 178258 [details]
Reproduction video of this bug

SUMMARY
When selecting an application in the Kicker using the arrow keys and then pressing Enter, the wrong application is started.
In my example I am searching for "ste" to find "Steam". Now "System Settings" is shown as the first item, which in itself feels wrong, but this is another issue. So now I press the arrow down button to select Steam. It is selected, but when I press enter, the Kicker still launches the System Settings, which are not selected.

STEPS TO REPRODUCE
1. Open Kicker with Meta key
2. Search for "ste"
3. Press arrow down to reach "Steam"
4. Press "Enter" to start "Steam"

OBSERVED RESULT
"System Settings" is started

EXPECTED RESULT
"Steam" should be started

SOFTWARE/OS VERSIONS
Operating System: Nobara Linux 41
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2
Kernel Version: 6.13.2-200.nobara.fc41.x86_64 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
I have attached a video, where you can see the reproduction.
Comment 1 cwo 2025-02-14 12:23:01 UTC
Can reproduce.

When searching for "ste", I get the following top three results: System Monitor, System Settings, Elisa.

If I select System Settings, System Monitor will start. Repeating it gives the same result. Selecting Elisa, however, activates Elisa, and after that, selecting System Settings will actually start System Settings, not System Monitor, and correct behavior seems to continue until Plasma is restarted.

Will investigate later to see if I can find the cause
Comment 2 cwo 2025-02-14 14:54:56 UTC
Git commit ec6363c385ed9f1a18af8e9d15b71b067fc99eef by Christoph Wolk.
Committed on 14/02/2025 at 14:50.
Pushed by cwo into branch 'kicker_focus_item'.

applets/kicker: actually select delegate on arrow

When the user presses an arrow key from the search field, the selection
is moved to the second or final entry in the list, depending on the key
pressed. Then focus is passed to the column. This doesn't work properly
though, as the actual keyboard focus does not end up on the delegate
yet, only after the user presses another arrow. If the user tries to
activate the item highlighted after a single key press, the Return press
falls back to the search field which always activates the first entry in
the list.

Instead, expose the actual highlighted list item, then focus it directly
instead of focusing the column.
FIXED-IN: 6.3.1

M  +2    -2    applets/kicker/package/contents/ui/MenuRepresentation.qml
M  +1    -0    applets/kicker/package/contents/ui/RunnerResultsList.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/ec6363c385ed9f1a18af8e9d15b71b067fc99eef
Comment 3 cwo 2025-02-14 15:43:36 UTC
The bot was a bit too enthusiastic here, the fix is not in quite yet. (My mistake though)
Comment 4 Bug Janitor Service 2025-02-14 18:10:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2812
Comment 5 cwo 2025-02-18 06:28:34 UTC
Git commit 8d10e42deb68273fa0254086ad4d280a0b905a8c by Christoph Wolk.
Committed on 18/02/2025 at 06:12.
Pushed by cwo into branch 'master'.

applets/kicker: actually select delegate on arrow

When the user presses an arrow key from the search field, the selection
is moved to the second or final entry in the list, depending on the key
pressed. Then focus is passed to the column. This doesn't work properly
though, as the actual keyboard focus does not end up on the delegate
yet, only after the user presses another arrow. If the user tries to
activate the item highlighted after a single key press, the Return press
falls back to the search field which always activates the first entry in
the list.

Instead, expose the actual highlighted list item, then focus it directly
instead of focusing the column.
FIXED-IN: 6.3.1

M  +2    -2    applets/kicker/package/contents/ui/MenuRepresentation.qml
M  +1    -0    applets/kicker/package/contents/ui/RunnerResultsList.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/8d10e42deb68273fa0254086ad4d280a0b905a8c
Comment 6 cwo 2025-02-18 06:54:25 UTC
Git commit 877ab88229509c44c061b4ee52d98de83a98b297 by Christoph Wolk.
Committed on 18/02/2025 at 06:38.
Pushed by cwo into branch 'Plasma/6.3'.

applets/kicker: actually select delegate on arrow

When the user presses an arrow key from the search field, the selection
is moved to the second or final entry in the list, depending on the key
pressed. Then focus is passed to the column. This doesn't work properly
though, as the actual keyboard focus does not end up on the delegate
yet, only after the user presses another arrow. If the user tries to
activate the item highlighted after a single key press, the Return press
falls back to the search field which always activates the first entry in
the list.

Instead, expose the actual highlighted list item, then focus it directly
instead of focusing the column.
FIXED-IN: 6.3.1


(cherry picked from commit 8d10e42deb68273fa0254086ad4d280a0b905a8c)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>

M  +2    -2    applets/kicker/package/contents/ui/MenuRepresentation.qml
M  +1    -0    applets/kicker/package/contents/ui/RunnerResultsList.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/877ab88229509c44c061b4ee52d98de83a98b297
Comment 7 Bug Janitor Service 2025-02-18 19:51:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2835
Comment 8 cwo 2025-02-20 20:32:33 UTC
Git commit 4fadac0f3ea12c3ce05cc2da50c9fb1265858db1 by Christoph Wolk.
Committed on 20/02/2025 at 19:37.
Pushed by cwo into branch 'master'.

applets/kicker: focus the delegate in all cases

70f5b766 accidentally reverted the fix to focusing the delegate instead
of the column for the down arrow, leaving it only for the up arrow as
originally introduced in 8d10e42d.

This change adds it back. This is also a good chance to apply the fix to
left and right arrow keys, to make sure focusing items in other columns
also works immediately and to keep things consistent.

M  +3    -3    applets/kicker/package/contents/ui/MenuRepresentation.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/4fadac0f3ea12c3ce05cc2da50c9fb1265858db1
Comment 9 Bug Janitor Service 2025-02-20 20:34:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2842
Comment 10 cwo 2025-02-20 20:45:07 UTC
Git commit 3bb631b4d094a27be64e9c8b23ea5a948551faf2 by Christoph Wolk.
Committed on 20/02/2025 at 20:33.
Pushed by cwo into branch 'Plasma/6.3'.

applets/kicker: focus the delegate in all cases

70f5b766 accidentally reverted the fix to focusing the delegate instead
of the column for the down arrow, leaving it only for the up arrow as
originally introduced in 8d10e42d.

This change adds it back. This is also a good chance to apply the fix to
left and right arrow keys, to make sure focusing items in other columns
also works immediately and to keep things consistent.


(cherry picked from commit 4fadac0f3ea12c3ce05cc2da50c9fb1265858db1)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>

M  +3    -3    applets/kicker/package/contents/ui/MenuRepresentation.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/3bb631b4d094a27be64e9c8b23ea5a948551faf2