fix(winit-orbital): handle EINTR when reading from event_socket

Signed-off-by: Anhad Singh <andypython@protonmail.com>
This commit is contained in:
Anhad Singh
2025-12-18 20:42:54 +11:00
committed by GitHub
parent 56333064ac
commit 50f9b84f6b
2 changed files with 10 additions and 1 deletions

View File

@@ -639,7 +639,15 @@ impl EventLoop {
// Wait for event if needed.
let mut event = syscall::Event::default();
self.window_target.event_socket.read(&mut event).unwrap();
loop {
match self.window_target.event_socket.read(&mut event) {
Ok(_) => break,
Err(syscall::Error { errno: syscall::EINTR }) => continue,
Err(err) => {
return Err(os_error!(format!("failed to read event: {err}")).into());
},
}
}
// TODO: handle spurious wakeups (redraw caused wakeup but redraw already handled)
match requested_resume {