aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-04-06 21:46:38 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-04-06 21:46:38 +0200
commit68856c3addc4dd575967111a7064c6221fa930f1 (patch)
treed9f4ba2b77fae409c683dc58848dfcd1c023a81c
parentb5a085343ef88e26624a76a75ae59c1c3d828cf5 (diff)
parent80a9e2c316d81908c5992541331010d3f0a64f47 (diff)
downloadglutin-68856c3addc4dd575967111a7064c6221fa930f1.tar.gz
glutin-68856c3addc4dd575967111a7064c6221fa930f1.zip
Merge pull request #361 from tomaka/x11-closing
Fix wait_events() not stopping when window is closed on 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
}
}