mirror of
https://github.com/encounter/SDL.git
synced 2025-12-11 14:41:56 +00:00
x11/wayland: Fix signal handling while blocking in WaitEventTimeout()
Add a new flag to avoid suppressing EINTR in SDL_IOReady(). Pass the flag in WaitEventTimeout() to ensure that a SIGINT will wake up SDL_WaitEvent() without another event coming in.
This commit is contained in:
committed by
Sam Lantinga
parent
c97c46877f
commit
a559864968
@@ -827,6 +827,7 @@ SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event * event,
|
||||
a) All pending events are batch processed after waking up from a wait
|
||||
b) Waiting can be completely skipped if events are already available to be pumped
|
||||
c) Periodic processing that takes place in some platform PumpEvents() functions happens
|
||||
d) Signals received in WaitEventTimeout() are turned into SDL events
|
||||
*/
|
||||
SDL_PumpEvents();
|
||||
|
||||
@@ -847,7 +848,6 @@ SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event * event,
|
||||
}
|
||||
if (status > 0) {
|
||||
/* There is an event, we can return. */
|
||||
SDL_SendPendingSignalEvents(); /* in case we had a signal handler fire, etc. */
|
||||
return 1;
|
||||
}
|
||||
/* No events found in the queue, call WaitEventTimeout to wait for an event. */
|
||||
|
||||
Reference in New Issue
Block a user