Fix panic when the process is suspended
In main event loop mio poll should immediately continue and retry on EINTR https://github.com/gergo-salyi/multibg-sway/issues/1
This commit is contained in:
parent
17c33ad756
commit
80f7f88532
1 changed files with 8 additions and 1 deletions
|
@ -119,7 +119,14 @@ fn main()
|
||||||
event_queue.dispatch_pending(&mut state).unwrap();
|
event_queue.dispatch_pending(&mut state).unwrap();
|
||||||
let mut read_guard_option = Some(event_queue.prepare_read().unwrap());
|
let mut read_guard_option = Some(event_queue.prepare_read().unwrap());
|
||||||
|
|
||||||
poll.poll(&mut events, None).unwrap();
|
if let Err(poll_error) = poll.poll(&mut events, None) {
|
||||||
|
if poll_error.kind() == io::ErrorKind::Interrupted {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
panic!("Main event loop poll failed: {:?}", poll_error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for event in events.iter() {
|
for event in events.iter() {
|
||||||
match event.token() {
|
match event.token() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue