x11:wayland: fix pump_events blocking with Wait
Using `Duration::Zero` with `Wait` polling mode was still blocking until the event was actually delivered. Thus when `pump_events` API is used, ensure that it's not happening. Fixes #4130.
This commit is contained in:
parent
afb731bb52
commit
a4ab7dc64c
3 changed files with 6 additions and 1 deletions
|
|
@ -240,3 +240,4 @@ changelog entry.
|
||||||
- On macOS, fixed redundant `SurfaceResized` event at window creation.
|
- On macOS, fixed redundant `SurfaceResized` event at window creation.
|
||||||
- On Windows, fixed ~500 ms pause when clicking the title bar during continuous redraw.
|
- 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 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
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,10 @@ impl EventLoop {
|
||||||
|
|
||||||
// Reduce spurious wake-ups.
|
// Reduce spurious wake-ups.
|
||||||
let dispatched_events = self.with_state(|state| state.dispatched_events);
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -568,6 +568,7 @@ impl EventLoop {
|
||||||
// If we don't have any pending `_receiver`
|
// If we don't have any pending `_receiver`
|
||||||
if !self.has_pending()
|
if !self.has_pending()
|
||||||
&& !matches!(&cause, StartCause::ResumeTimeReached { .. } | StartCause::Poll)
|
&& !matches!(&cause, StartCause::ResumeTimeReached { .. } | StartCause::Poll)
|
||||||
|
&& timeout.is_none()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue