diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index 587863045..a75ff6941 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -48,3 +48,4 @@ changelog entry. - 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 f379841a6..b4c69b0f5 100644 --- a/src/platform_impl/linux/wayland/event_loop/mod.rs +++ b/src/platform_impl/linux/wayland/event_loop/mod.rs @@ -285,7 +285,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 4042da0d0..6d3f93115 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -497,6 +497,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; }