mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-23 18:36:34 +11:00
Fix wait_events() not stopping when window is closed on X11
This commit is contained in:
parent
b5a085343e
commit
80a9e2c316
1 changed files with 3 additions and 1 deletions
|
@ -255,7 +255,7 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
|
|||
fn next(&mut self) -> Option<Event> {
|
||||
use std::mem;
|
||||
|
||||
loop {
|
||||
while !self.window.is_closed() {
|
||||
if let Some(ev) = self.window.pending_events.lock().unwrap().pop_front() {
|
||||
return Some(ev);
|
||||
}
|
||||
|
@ -270,6 +270,8 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
|
|||
return Some(ev);
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue