aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-04-06 16:47:39 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-04-06 16:47:39 +0200
commit80a9e2c316d81908c5992541331010d3f0a64f47 (patch)
treed9f4ba2b77fae409c683dc58848dfcd1c023a81c /src/x11
parentb5a085343ef88e26624a76a75ae59c1c3d828cf5 (diff)
downloadglutin-80a9e2c316d81908c5992541331010d3f0a64f47.tar.gz
glutin-80a9e2c316d81908c5992541331010d3f0a64f47.zip
Fix wait_events() not stopping when window is closed on X11
Diffstat (limited to 'src/x11')
-rw-r--r--src/x11/window/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs
index 3820bd4..7121ac6 100644
--- a/src/x11/window/mod.rs
+++ b/src/x11/window/mod.rs
@@ -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
}
}