Bug 459322

Summary: Pressed keys are not properly detected when I try to set a keyboard shortcut
Product: [Unmaintained] kscreenlocker Reporter: Patrick Silva <bugseforuns>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol, bshah, kde, kdelibs-bugs-null, nate
Priority: NOR Keywords: usability
Version First Reported In: 5.25.5   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: Plasma 5.26.2 with Frameworks 5.100
Sentry Crash Report:
Attachments: screen recording

Description Patrick Silva 2022-09-18 12:07:58 UTC
Created attachment 152183 [details]
screen recording

The title says it all. In the attached screen recording we can see what happens when I try to set meta+L in Screen Loking KCM and meta+m in Notifications KCM. If I clear the incorrectly detected shortcut and try to set the same shortcut again, 
the pressed keys are properly detected.

EXPECTED RESULT
pressed keys should always be properly detected when we try to set a keyboard shortcut.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Graphics Platform: Wayland

ADDITIONAL INFORMATION
I'm unable to reproduce with Task Switcher KCM
Comment 1 Nate Graham 2022-09-23 16:55:40 UTC
Can reproduce. Seems like a bug in KQuickControls.KeySequenceItem.
Comment 3 Aleix Pol 2022-09-28 15:10:36 UTC
Git commit abc7f5cfaf4a5a88260fad33b5db99551f30ee2c by Aleix Pol.
Committed on 28/09/2022 at 13:12.
Pushed by apol into branch 'master'.

kcm: Only assign the shortcut once it's finished capturing

M  +1    -1    kcm/package/contents/ui/main.qml

https://invent.kde.org/plasma/kscreenlocker/commit/abc7f5cfaf4a5a88260fad33b5db99551f30ee2c
Comment 4 Aleix Pol 2022-09-28 15:11:30 UTC
Git commit 3bfad8d33479efbd3d203bf53e9d01debfadbf56 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 28/09/2022 at 15:11.
Pushed by apol into branch 'Plasma/5.26'.

kcm: Only assign the shortcut once it's finished capturing


(cherry picked from commit abc7f5cfaf4a5a88260fad33b5db99551f30ee2c)

M  +1    -1    kcm/package/contents/ui/main.qml

https://invent.kde.org/plasma/kscreenlocker/commit/3bfad8d33479efbd3d203bf53e9d01debfadbf56
Comment 5 Patrick Silva 2022-10-15 13:02:02 UTC
It's still reproducible with Notifications KCM on Arch Linux and neon unstable.
Comment 6 Bug Janitor Service 2022-10-19 00:29:59 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1215
Comment 7 Bug Janitor Service 2022-10-19 00:37:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2234
Comment 8 Aleix Pol 2022-10-19 13:23:08 UTC
Git commit 0d0626d52d83369ff437f9b7234f5acf6f9ec2b4 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 19/10/2022 at 13:13.
Pushed by apol into branch 'master'.

Use KeySequenceItem.captureFinished to notify a binding has been entered

Otherwise we enter in weird cases when the UI needs to programatically
change the current value of the shortcut.

M  +1    -1    kcms/notifications/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/commit/0d0626d52d83369ff437f9b7234f5acf6f9ec2b4
Comment 9 Aleix Pol 2022-10-19 13:25:50 UTC
Git commit 20eb1a738e5443ad0f555e7b3b24c881ee13a60e by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 19/10/2022 at 13:21.
Pushed by apol into branch 'master'.

Use KeySequenceItem.captureFinished to notify a binding has been entered

Otherwise we enter in weird cases when the UI needs to programatically
change the current value of the shortcut.

M  +1    -1    desktoppackage/contents/configuration/ConfigurationShortcuts.qml
M  +5    -7    kcms/mouse/kcm/libinput/main.qml

https://invent.kde.org/plasma/plasma-desktop/commit/20eb1a738e5443ad0f555e7b3b24c881ee13a60e
Comment 10 Aleix Pol 2022-10-19 13:32:38 UTC
Git commit 56a125da2b0514e2da9e621823fcd6283e6f05d4 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 19/10/2022 at 13:32.
Pushed by apol into branch 'Plasma/5.26'.

Use KeySequenceItem.captureFinished to notify a binding has been entered

Otherwise we enter in weird cases when the UI needs to programatically
change the current value of the shortcut.


(cherry picked from commit 0d0626d52d83369ff437f9b7234f5acf6f9ec2b4)

M  +1    -1    kcms/notifications/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/commit/56a125da2b0514e2da9e621823fcd6283e6f05d4
Comment 11 Aleix Pol 2022-10-19 13:32:58 UTC
Git commit 873025e29946a75e1a13a5aa4cebcfdb4e473396 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 19/10/2022 at 13:32.
Pushed by apol into branch 'Plasma/5.26'.

Use KeySequenceItem.captureFinished to notify a binding has been entered

Otherwise we enter in weird cases when the UI needs to programatically
change the current value of the shortcut.


(cherry picked from commit 20eb1a738e5443ad0f555e7b3b24c881ee13a60e)

M  +1    -1    desktoppackage/contents/configuration/ConfigurationShortcuts.qml
M  +5    -7    kcms/mouse/kcm/libinput/main.qml

https://invent.kde.org/plasma/plasma-desktop/commit/873025e29946a75e1a13a5aa4cebcfdb4e473396