Bug 433723 - krunner prints strange character when pressing Esc in the history dropdown
Summary: krunner prints strange character when pressing Esc in the history dropdown
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: 5.21.1
Platform: Slackware Linux
: NOR minor (vote)
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-27 22:58 UTC by Ricardo J. Barberis
Modified: 2021-03-02 12:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.21.2


Attachments
krunner window with strange character (2.13 KB, image/png)
2021-02-27 22:58 UTC, Ricardo J. Barberis
Details

Note You need to log in before you can comment on or make changes to this bug.
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