mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Fix wait_events() not stopping when window is closed on X11
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user