diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index af998577..792e5759 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -240,3 +240,4 @@ changelog entry. - On macOS, fixed redundant `SurfaceResized` event at window creation. - On Windows, fixed ~500 ms pause when clicking the title bar during continuous redraw. - On macos, `WindowExtMacOS::set_simple_fullscreen` now honors `WindowExtMacOS::set_borderless_game` +- On X11 and Wayland, fixed pump_events with `Some(Duration::Zero)` blocking with `Wait` polling mode diff --git a/src/platform_impl/linux/wayland/event_loop/mod.rs b/src/platform_impl/linux/wayland/event_loop/mod.rs index 8024df16..4e640eeb 100644 --- a/src/platform_impl/linux/wayland/event_loop/mod.rs +++ b/src/platform_impl/linux/wayland/event_loop/mod.rs @@ -272,7 +272,10 @@ impl EventLoop { // Reduce spurious wake-ups. let dispatched_events = self.with_state(|state| state.dispatched_events); - if matches!(cause, StartCause::WaitCancelled { .. }) && !dispatched_events { + if matches!(cause, StartCause::WaitCancelled { .. }) + && !dispatched_events + && timeout.is_none() + { continue; } diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs index 44c68e8e..9a92b1fd 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -568,6 +568,7 @@ impl EventLoop { // If we don't have any pending `_receiver` if !self.has_pending() && !matches!(&cause, StartCause::ResumeTimeReached { .. } | StartCause::Poll) + && timeout.is_none() { return; }