Wayland: Fix spurious key repeat events when some user defined callback takes a long time to execute

On compositors that support compositor key repeat events, use those, for
complete robustness. Sadly no actual compositor implements these yet.

Otherwise use a timer fd/pipe to queue the repeat events and only
dispatch them after events from the compositor are handled. This means
release events from the compositor will prevent spurious repeat events.
One can, in the worst case lose some repeat events if there is a very
large interval between the start of the timer and the next poll, but
that is unavoidable and is why repeat events should come from the compositor
in the first place.

Fixes #9224
This commit is contained in:
Kovid Goyal
2025-12-03 22:26:09 +05:30
parent 7d24c82d4d
commit 16008b950a
5 changed files with 103 additions and 24 deletions

View File

@@ -181,6 +181,9 @@ Detailed list of changes
pager in search mode. If any text is currently selected it is automatically
searched for.
- Wayland: Fix spurious key repeat events when some user defined callback takes
a long time to execute (:iss:`9224`)
0.44.0 [2025-11-03]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~