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 authored and Kirill Chibisov committed 2026-09-05 03:18:46 +09:00
1 parent a6fe777c09
commit 7a78bb8613
2 files changed
+10 -1

No files matched your search

+9 -1
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 {
+1
View File
@@ -47,3 +47,4 @@ changelog entry.
### Fixed
- On X11, fix `set_hittest` not working on some window managers.
- On Redox, handle `EINTR` when reading from `event_socket` instead of panicking.