Bug 483789

Summary: While holding down shortcut to open or close an effect such as Overview, Grid, etc. the effect constantly open and closes manically
Product: [Plasma] kwin Reporter: postix <postix>
Component: effects-variousAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: fanzhuyifan, nate
Priority: NOR Keywords: accessibility, qt6
Version First Reported In: 6.0.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=445608
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description postix 2024-03-16 20:16:45 UTC
STEPS TO REPRODUCE
Press Meta + G to open the grid and keep holding down both keys

OBSERVED RESULT
The effect opens and closes manically. 

EXPECTED RESULT
The effect only opens once.


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240314
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.9-1-default (64-bit)
Graphics Platform: Wayland
Comment 1 guimarcalsilva 2024-03-16 20:40:39 UTC
I can reproduce it.
Comment 2 fanzhuyifan 2024-03-16 23:51:54 UTC
Currently shortcuts trigger on press, and will re-trigger upon key autorepeat. If we don't plan on changing that, this should be closed as resolved-intentional.

Note that for other shortcuts (like ctrl-V), users would probably expect this behavior. So IMO this is intentional.
Comment 3 postix 2024-03-17 11:06:01 UTC
(In reply to fanzhuyifan from comment #2)
> Note that for other shortcuts (like ctrl-V), users would probably expect
> this behavior. So IMO this is intentional.

IMO there should be two types of hot-keys, those that re-trigger (Ctrl+V, Ctrl+R/Z, ...) and those that don't (Meta+G, Meta+O,Meta+C, Meta+Tab*).

Having the mentioned effects for instance auto-re-trigger seems just wrong. Kickoff for instance doesn't open/close repeatedly when holding down Meta.  For Meta+Tab it could make sense, but the speed with it switches between windows is way too fast to be usable.
Comment 4 fanzhuyifan 2024-03-17 14:36:19 UTC
Modifier only shortcuts are handled differently and are triggered on release since it doesn't make sense to trigger them on press.

The repeat speed is controlled by key repeat settings.

If we support two types of shortcuts, we have to think about whether we expose that to the users. Not exposing that might make things confusing, where some shortcuts trigger on repeat and some don't, while exposing the setting might make things too complicated.
Comment 5 Vlad Zahorodnii 2024-03-18 10:20:35 UTC
(In reply to fanzhuyifan from comment #2)
> Currently shortcuts trigger on press, and will re-trigger upon key
> autorepeat. If we don't plan on changing that, this should be closed as
> resolved-intentional.
> 
> Note that for other shortcuts (like ctrl-V), users would probably expect
> this behavior. So IMO this is intentional.

Yes, that's intentional.
Comment 6 postix 2024-03-18 10:27:19 UTC
> Yes, that's intentional.

But what about

> IMO there should be two types of hot-keys, those that re-trigger (Ctrl+V, Ctrl+R/Z, ...) and those that don't (Meta+G, Meta+O,Meta+C, Meta+Tab*).

May I open another more general issue for it? I mean it doesn't need to be resolved immediately but it could be on the radar and implemented later ...
Comment 7 fanzhuyifan 2024-03-20 00:45:14 UTC
(In reply to postix from comment #6)
> May I open another more general issue for it? I mean it doesn't need to be
> resolved immediately but it could be on the radar and implemented later ...

This introduces inconsistencies in how shortcuts are handled, complicates the UX, and adds more code complexity for little benefit.
Comment 8 postix 2024-04-23 11:42:37 UTC
> complicates the UX, and adds more code complexity for little benefit.

Maybe not too little benefit: One legit reason which came into my mind is that it could be an issue for people with epilepsy [1]:
> Content that flickers, flashes, or blinks can trigger photosensitive epilepsy. 

The rapid opening/closing is definitely kind of a flickering/flashing effect, though I don't have any experience with it myself nor do I know people who may be affected to absolutely proof it. But if it is, it should maybe be avoided at any cost?

[1] https://developer.mozilla.org/en-US/docs/Web/Accessibility/Seizure_disorders
Comment 9 postix 2025-06-21 13:38:19 UTC
https://invent.kde.org/plasma/plasma-desktop/-/issues/149
> Audit for seizure-inducing flashing (faster than 3 Hz according to WCAG), and get rid of it

I would argue this issue is covered by the above rule ^
Comment 10 postix 2025-06-21 13:39:22 UTC
CC Nate, because he's assigned for "Plasma desktop shell: EU Directive 2019/882 compliance". 
Please see comment https://bugs.kde.org/show_bug.cgi?id=483789#c9
Comment 11 postix 2025-06-25 10:25:55 UTC
If I read 

https://invent.kde.org/plasma/kwin/-/merge_requests/7818 
> benefit is being able to call QAction::setAutoRepeat(false) to ignore key repeat events in any effect where it makes sense to ignore them.

correctly, this issue could now be easily resolved? :-)
Comment 12 Nate Graham 2025-06-25 20:00:41 UTC
Yeah, re-opening because this kind of full-screen flickering is problematic for photosensitive people.
Comment 13 Ritchie Frodomar 2025-07-23 15:36:49 UTC
Git commit 7e348f0bbd6fe43d8c7b788c663904c8e3c1c617 by Ritchie Frodomar.
Committed on 23/07/2025 at 15:36.
Pushed by acidiclight into branch 'master'.

plugins/invert: Ignore key repeat in color inversion toggle shortcuts

Part of https://invent.kde.org/plasma/plasma-desktop/-/issues/149.

This merge request prevents the toggle shortcuts in the Invert effect from constantly flashing the screen. This required making changes to kglobalaccel to facilitate detecting key repeat, but the benefit is being able to call `QAction::setAutoRepeat(false)` to ignore key repeat events in any effect where it makes sense to ignore them.

Related MRs:

 - https://invent.kde.org/plasma/kglobalacceld/-/merge_requests/76
 - https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/124

M  +8    -19   src/globalshortcuts.cpp
M  +3    -2    src/globalshortcuts.h
M  +4    -4    src/input.cpp
M  +2    -0    src/plugins/invert/invert.cpp
M  +10   -6    src/plugins/kglobalaccel/kglobalaccel_plugin.cpp
M  +3    -2    src/plugins/kglobalaccel/kglobalaccel_plugin.h
M  +2    -0    src/plugins/overview/overvieweffect.cpp
M  +72   -71   src/useractions.cpp
M  +2    -2    src/workspace.h

https://invent.kde.org/plasma/kwin/-/commit/7e348f0bbd6fe43d8c7b788c663904c8e3c1c617
Comment 14 Vlad Zahorodnii 2025-07-28 11:24:10 UTC
Git commit d4b3112727aa9e2ef0e69ae0730fc525966fa97e by Vlad Zahorodnii, on behalf of Ritchie Frodomar.
Committed on 28/07/2025 at 08:51.
Pushed by vladz into branch 'master'.

plugins/invert: Ignore key repeat in color inversion toggle shortcuts

Part of https://invent.kde.org/plasma/plasma-desktop/-/issues/149.

This merge request prevents the toggle shortcuts in the Invert effect from constantly flashing the screen. This required making changes to kglobalaccel to facilitate detecting key repeat, but the benefit is being able to call `QAction::setAutoRepeat(false)` to ignore key repeat events in any effect where it makes sense to ignore them.

Related MRs:

 - https://invent.kde.org/plasma/kglobalacceld/-/merge_requests/76
 - https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/124
(cherry picked from commit 7e348f0bbd6fe43d8c7b788c663904c8e3c1c617)

M  +7    -19   src/globalshortcuts.cpp
M  +3    -2    src/globalshortcuts.h
M  +4    -4    src/input.cpp
M  +2    -0    src/plugins/invert/invert.cpp
M  +10   -6    src/plugins/kglobalaccel/kglobalaccel_plugin.cpp
M  +3    -2    src/plugins/kglobalaccel/kglobalaccel_plugin.h
M  +2    -0    src/plugins/overview/overvieweffect.cpp
M  +74   -73   src/useractions.cpp
M  +2    -2    src/workspace.h

https://invent.kde.org/plasma/kwin-x11/-/commit/d4b3112727aa9e2ef0e69ae0730fc525966fa97e