Bug 479233

Summary: An app opens when clearing the search field of Kickoff
Product: [Plasma] plasmashell Reporter: Patrick Silva <bugseforuns>
Component: Application Launcher (Kickoff)Assignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: agurenko, Christoph.Wolk, elydgolden, martin+kde, mikel5764, nate, noahadvs, typingcat
Priority: NOR Keywords: qt6
Version: 5.91.0   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=492842
Latest Commit: Version Fixed In: 6.2.0
Sentry Crash Report:
Attachments: Showcase of bug
Bug demo (more cases of it activating different selections)

Description Patrick Silva 2023-12-31 21:08:50 UTC
STEPS TO REPRODUCE
1. open and pin Kickoff
2. search for an app and open it
3. clean the search field by clicking on its "X" button

OBSERVED RESULT
a random app opens

EXPECTED RESULT
no app opens

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.91.0
KDE Frameworks Version: 5.247.0
Qt Version: 6.7.0
Graphics Platform: Wayland
Comment 1 Nate Graham 2024-01-11 20:00:44 UTC
Wow, can reproduce.
Comment 2 Nate Graham 2024-05-24 23:04:28 UTC
*** Bug 487454 has been marked as a duplicate of this bug. ***
Comment 3 Martin Bednar 2024-06-01 11:24:35 UTC
Created attachment 170045 [details]
Showcase of bug

I don't think it's random: the application opened is the last selected (hovered over) in the favourites section. 
I can select which application will "randomly" open by 

1. open kickoff
2. navigate favourites using keyboard (don't move the cursor)
3. start typing to search  (still don't move the cursor)
4. move cursor over the "clear search bar" button & click
5. application selected in step 2 will open.

See the attached video. it's a bit fast for some reason, but still usable to understand.
Comment 4 cwo 2024-07-14 09:55:47 UTC
*** Bug 490222 has been marked as a duplicate of this bug. ***
Comment 5 cwo 2024-07-14 10:10:40 UTC
This doesn't seem limited to pinned kickoff but can be triggered in other ways, and the app is not random but a previously focused one, see the comments and duplicates. I'm editing the title to reflect this.
Comment 6 elydgolden 2024-07-14 11:03:10 UTC
Created attachment 171655 [details]
Bug demo (more cases of it activating different selections)
Comment 7 Bug Janitor Service 2024-07-15 17:05:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libplasma/-/merge_requests/1171
Comment 8 Bug Janitor Service 2024-07-15 17:22:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2389
Comment 9 Bug Janitor Service 2024-07-23 22:02:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2397
Comment 10 Nate Graham 2024-09-03 15:26:30 UTC
Git commit fd6c2bf2ad7c022a464c0799ea0256fb692d6618 by Nate Graham, on behalf of David Edmundson.
Committed on 03/09/2024 at 15:26.
Pushed by ngraham into branch 'master'.

applets/kickoff: Move enter key handling to listviews

Kickoff has a model where the main view forwards key events to the
search field, and the search field forwards keys to the main view.

Right now the enter key is handled by the search field to activate
the current item in the view.

This doesn't make sense semantically: committing input text should
not activate an item, it should apply the search, which isn't needed
as we search as we type. This could break input methods and the
clear button.

Activating the current item in a view should be encapsulated within
the view.
FIXED-IN: 6.2.0

M  +0    -4    applets/kickoff/package/contents/ui/Header.qml
M  +6    -0    applets/kickoff/package/contents/ui/KickoffGridView.qml
M  +6    -0    applets/kickoff/package/contents/ui/KickoffListView.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/fd6c2bf2ad7c022a464c0799ea0256fb692d6618