SDL/src
Joan Bruguera 9e6249fa54 wayland: Avoid spurious key repeats when not pumping events
Previous to this commit, key repeats events were typically generated when
pumping events, based on the time of when the events are pumped. However,
if an application doesn't call `SDL_PumpEvents` for some seconds, this time
can be multiple seconds in the future compared to the actual key up event time,
and generates key repeats even if a key was pressed only for an instant.

In practice, this can happen when the user presses a key which causes the
application to do something without pumping events (e.g. load a level).
In Crispy Doom & PrBoom+, when the user presses the key bound to "Restart
level/demo", the game doesn't pump events during the "screen melt" effect,
and the level is restarted multiple times due to spurious repeats.

To fix this, if the key up event is among the events to be pumped, we generate
the key repeats there, since in the Wayland callback we receive the time when
the key up event happened. Otherwise, we know no key up event happened and we
can generate as many repeats as necessary after pumping.

Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2022-01-08 14:10:22 -08:00
..
atomic Updated copyright for 2022 2022-01-03 09:40:21 -08:00
audio Improve audio compatibility in PSP. Now it supports more formats and frequencies 2022-01-05 19:15:41 -05:00
core Updated copyright for 2022 2022-01-03 09:40:21 -08:00
cpuinfo Updated copyright for 2022 2022-01-03 09:40:21 -08:00
dynapi Updated copyright for 2022 2022-01-03 09:40:21 -08:00
events Fixed getting different results for SDL_PollEvent(NULL) and SDL_PollEvent(&event) 2022-01-08 08:49:34 -08:00
file SDL_rwops.c: simplify `foo <= 0` checks to `!foo` with unsigned types. 2022-01-04 11:40:04 +03:00
filesystem psp/SDL_sysfilesystem.c: fixed a minor compiler warning. 2022-01-08 11:55:10 +03:00
haptic Updated copyright for 2022 2022-01-03 09:40:21 -08:00
hidapi Updated copyright for 2022 2022-01-03 09:40:21 -08:00
joystick Filter jitter on Xbox One controllers when using raw input reports 2022-01-05 11:07:52 -08:00
libm Updated copyright for 2022 2022-01-03 09:40:21 -08:00
loadso Updated copyright for 2022 2022-01-03 09:40:21 -08:00
locale Updated copyright for 2022 2022-01-03 09:40:21 -08:00
main Updated to version 2.0.20 for release 2022-01-07 18:29:40 -08:00
misc Updated copyright for 2022 2022-01-03 09:40:21 -08:00
power Updated copyright for 2022 2022-01-03 09:40:21 -08:00
render Fixed compile warning 2022-01-08 14:07:42 -08:00
sensor Updated copyright for 2022 2022-01-03 09:40:21 -08:00
stdlib Updated copyright for 2022 2022-01-03 09:40:21 -08:00
test Updated copyright for 2022 2022-01-03 09:40:21 -08:00
thread Updated copyright for 2022 2022-01-03 09:40:21 -08:00
timer Updated copyright for 2022 2022-01-03 09:40:21 -08:00
video wayland: Avoid spurious key repeats when not pumping events 2022-01-08 14:10:22 -08:00
SDL.c Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_assert.c Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_assert_c.h Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_dataqueue.c Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_dataqueue.h Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_error.c Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_error_c.h Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_hints.c Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_hints_c.h Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_internal.h Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_log.c Updated copyright for 2022 2022-01-03 09:40:21 -08:00