From 4ec5078bdbeb86420fec1a0243c52c53359ea51b Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Thu, 11 May 2017 23:00:22 -0700 Subject: [PATCH] Fix poll_events on x11 not draining completely If the interrupted flag were set going into poll_events, it would only ever handle the first event in the queue. Now, the flag is reset at the start so events are processed until the caller requests otherwise. --- src/platform/linux/x11/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/linux/x11/mod.rs b/src/platform/linux/x11/mod.rs index 9f9f06f3..7535e42e 100644 --- a/src/platform/linux/x11/mod.rs +++ b/src/platform/linux/x11/mod.rs @@ -126,6 +126,7 @@ impl EventsLoop { pub fn poll_events(&self, mut callback: F) where F: FnMut(Event) { + self.interrupted.store(false, ::std::sync::atomic::Ordering::Relaxed); let xlib = &self.display.xlib; let mut xev = unsafe { mem::uninitialized() };