From ea28791da6c7ab7d4cf6667e64eaed6afab72bbc Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Sun, 29 Apr 2018 01:03:06 +0200 Subject: [PATCH] x11: Always receive Awakened event in run_forever (#489) * x11: Always receive Awakened event in run_forever Do not reset the pending_wakeup boolean at the start of run_forever so that each call to EventsLoopProxy::wakeup results in an Awakened event. Fixes #462 * Update CHANGELOG.md --- CHANGELOG.md | 1 + src/platform/linux/x11/mod.rs | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a624693..bc907c40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Implemented `Moved` event on macOS. - On Windows, implemented all variants of `DeviceEvent` other than `Text`. Mouse `DeviceEvent`s are now received even if the window isn't in the foreground. - `DeviceId` on Windows is no longer a unit struct, and now contains a `u32`. For `WindowEvent`s, this will always be 0, but on `DeviceEvent`s it will be the handle to that device. `DeviceIdExt::get_persistent_identifier` can be used to acquire a unique identifier for that device that persists across replugs/reboots/etc. +- Corrected `run_forever` on X11 to stop discarding `Awakened` events. # Version 0.13.1 (2018-04-26) diff --git a/src/platform/linux/x11/mod.rs b/src/platform/linux/x11/mod.rs index 6327b139..64eb42aa 100644 --- a/src/platform/linux/x11/mod.rs +++ b/src/platform/linux/x11/mod.rs @@ -190,8 +190,6 @@ impl EventsLoop { pub fn run_forever(&mut self, mut callback: F) where F: FnMut(Event) -> ControlFlow { - self.pending_wakeup.store(false, atomic::Ordering::Relaxed); - let mut xev = unsafe { mem::uninitialized() }; loop {