Bug 433723

Summary: krunner prints strange character when pressing Esc in the history dropdown
Product: [Plasma] krunner Reporter: Ricardo J. Barberis <ricardo>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: RESOLVED FIXED    
Severity: minor CC: plasma-bugs
Priority: NOR    
Version: 5.21.1   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In: 5.21.2
Attachments: krunner window with strange character

Description Ricardo J. Barberis 2021-02-27 22:58:58 UTC
Created attachment 136241 [details]
krunner window with strange character

SUMMARY
What the title says :)

STEPS TO REPRODUCE
1. Open krunner (Alt+spacebar)
2. Hit the arrow-down key to see the history
3. Press Esc to cancel the action


OBSERVED RESULT
krunner prints a strange character in its input window, see attached screenshot.


EXPECTED RESULT
krunner either closes or stays open but without printing anything ons its input window


SOFTWARE/OS VERSIONS
Operating System: Slackware 15.0alpha1 (-current)
KDE Plasma Version: 5.21.1
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.10.18
OS Type: 64-bit
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-1035G1 CPU @ 1.00GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics


ADDITIONAL INFORMATION
Comment 1 Alexander Lohnau 2021-02-28 08:19:21 UTC
That is because it forwards the pressed keys to the text field. And unlike characters like a, b, c... an escape key is not a printable character.

I guess ideally the history view gets closed and the text field gets focused.
Comment 2 Bug Janitor Service 2021-02-28 08:34:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/680
Comment 3 Ricardo J. Barberis 2021-02-28 20:58:42 UTC
Thank you for the prompt response and patch!

Indeed, it happens with other keys/non-printable characters, like hitting backspace or Ctrl + any of '[', ']', '\' for example.
Comment 4 Alexander Lohnau 2021-03-02 12:06:51 UTC
Git commit 83982f8e5cdad5b5dd89fb2dafee91a03eed4070 by Alexander Lohnau.
Committed on 02/03/2021 at 11:46.
Pushed by alex into branch 'master'.

KRunner: Handle escape key in history view more gracefully

Instead of adding an unprintable character to the UI the history view is
closed and the text field it focused.

To prevent unprintable characters like backspace a regex is used,
just like we already do in the ResultsView Keys.onPressed slot.
FIXED-IN: 5.21.2

M  +6    -1    lookandfeel/contents/runcommand/RunCommand.qml

https://invent.kde.org/plasma/plasma-workspace/commit/83982f8e5cdad5b5dd89fb2dafee91a03eed4070
Comment 5 Alexander Lohnau 2021-03-02 12:15:23 UTC
Git commit c4db9bd1e960e3ec7b6c460441ee622c4a582fc9 by Alexander Lohnau.
Committed on 02/03/2021 at 12:07.
Pushed by alex into branch 'Plasma/5.21'.

KRunner: Handle escape key in history view more gracefully

Instead of adding an unprintable character to the UI the history view is
closed and the text field it focused.

To prevent unprintable characters like backspace a regex is used,
just like we already do in the ResultsView Keys.onPressed slot.
FIXED-IN: 5.21.2

M  +6    -1    lookandfeel/contents/runcommand/RunCommand.qml

https://invent.kde.org/plasma/plasma-workspace/commit/c4db9bd1e960e3ec7b6c460441ee622c4a582fc9