mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 06:41:31 +11:00
Merge pull request #361 from tomaka/x11-closing
Fix wait_events() not stopping when window is closed on X11
This commit is contained in:
commit
68856c3add
|
@ -255,7 +255,7 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
|
||||||
fn next(&mut self) -> Option<Event> {
|
fn next(&mut self) -> Option<Event> {
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
loop {
|
while !self.window.is_closed() {
|
||||||
if let Some(ev) = self.window.pending_events.lock().unwrap().pop_front() {
|
if let Some(ev) = self.window.pending_events.lock().unwrap().pop_front() {
|
||||||
return Some(ev);
|
return Some(ev);
|
||||||
}
|
}
|
||||||
|
@ -270,6 +270,8 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
|
||||||
return Some(ev);
|
return Some(ev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue