SUMMARY Modifier only shortcuts on X11 trigger on "press" action instead of "release". This results in triggering multiple shortcuts when pressing a shortcut with modifier. STEPS TO REPRODUCE 1. Bind a shortcut to a modifier (for example "super/meta" key for krunner) 2. Bind meta+space to another shortcut (in my case it triggers keyboard layout switch via fcitx5) 3. Press meta+space OBSERVED RESULT Both shortcuts got triggered (keyboard layout switch + krunner) EXPECTED RESULT Only meta+space shortcut triggers (keyboard layout switch) SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Plasma Version: 5.26.90 KDE Frameworks Version: 5.102.0 Qt Version: 5.15.8 Xorg 21.1.6-1
Works for me on Wayland FWIW.
possibly duplicate of bug 452113
Hmm, maybe the have the same root cause? Needs investigation.
There are two paths for modifier only shortcuts: - kwin did a path of modifier shortcuts, which was release only - in kglobalaccel a modifier only shortcut will fire on press, like another shortcut. It's slightly more complex as that kglobalaccel usage was designed to cover press-to-talk like cases. Those can't be delayed. It will need to be a flag on shortcut bind or done exclusively client side
I can reproduce this issue in Plasma 6 on Wayland: When setting a modifier only shortcut, it triggers on key press. If the same modifier is used in another shortcut (for example CTRL vs CTRL+S) than both events are being triggered, though if the modifier-only shortcut is quick enough to grab focus away from the application that is supposed to handle the second shortcut, then it might not happen at all. For example: STEPS TO REPRODUCE: 1. In the keyboard shortcut settings, find Krunner and add to it a shortcut of "Control". 2. Start another application that can "save" on CTRL+S - for example, Firefox. 3. Press CTRL+S OBSERVED RESULT Krunner appears. EXPECTED RESULT The "Save" dialog should come up.
(In reply to Nate Graham from comment #1) > Works for me on Wayland FWIW. What was your test Nate? Can you confirm the fail above?
(In reply to Oded Arbel from comment #5) > I can reproduce this issue in Plasma 6 on Wayland: > ... > STEPS TO REPRODUCE: > 1. In the keyboard shortcut settings, find Krunner and add to it a shortcut > of "Control". > 2. Start another application that can "save" on CTRL+S - for example, > Firefox. > 3. Press CTRL+S Setting up modifier-only shortcuts using kwinrc ([ModifierOnlyShortcuts] section), instead of using the System Settings shortcuts KCM, the modifier-only shortcut does trigger correctly on release. I'm not sure what the KCM is doing that is different than setting the kwinrc setting, but there are obviously two different systems that pertain to do the same thing, where one of them is doing it wrong.
*** Bug 479807 has been marked as a duplicate of this bug. ***
*** Bug 481373 has been marked as a duplicate of this bug. ***
Moved to kglobalaccel since the modifier-only shortcuts handled by kwin activate on release, and this is about regular shortcuts handled by a different code path.
Also just a heads-up that I plan to take a look at this some time.
https://invent.kde.org/plasma/kglobalacceld/-/merge_requests/44
Git commit d20d58d4729fd94b3373b803de89054c2e2550de by Yifan Zhu. Committed on 20/03/2024 at 17:00. Pushed by fanzhuyifan into branch 'master'. Enhance modifier-only shortcuts Trigger modifier-only shortcuts trigger on release, and support multi-key modifier-only shortcuts, which trigger only when all the modifiers are released within some interval. Related: bug 470256 M +50 -19 src/globalshortcutsregistry.cpp M +15 -0 src/globalshortcutsregistry.h M +38 -1 src/sequencehelpers_p.cpp M +2 -0 src/sequencehelpers_p.h https://invent.kde.org/plasma/kglobalacceld/-/commit/d20d58d4729fd94b3373b803de89054c2e2550de
*** Bug 474024 has been marked as a duplicate of this bug. ***
*** Bug 467341 has been marked as a duplicate of this bug. ***