-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Is ControlFlow supposed to be sticky? (eventloop-2.0) #891
Copy link
Copy link
Closed
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedD - easyLikely easier than most tasks hereLikely easier than most tasks hereDS - waylandAffects the Wayland backend, or generally free Unix platformsAffects the Wayland backend, or generally free Unix platformsDS - x11Affects the X11 backend, or generally free Unix platformsAffects the X11 backend, or generally free Unix platformsH - good first issueIdeal for new contributorsIdeal for new contributors
Description
Based on the doc comment, I would believe that it is intended to be sticky. However, the x11 and wayland implementations are resetting it per loop iteration. It doesn't look like Windows is doing this.
Lines 65 to 69 in 0df4369
| /// ## Persistency | |
| /// Almost every change is persistent between multiple calls to the event loop closure within a | |
| /// given run loop. The only exception to this is `Exit` which, once set, cannot be unset. Changes | |
| /// are **not** persistent between multiple calls to `run_return` - issuing a new call will reset | |
| /// the control flow to `Poll`. |
winit/src/platform_impl/linux/x11/mod.rs
Lines 283 to 286 in 0df4369
| ControlFlow::Poll => { | |
| // non-blocking dispatch | |
| self.inner_loop.dispatch(Some(::std::time::Duration::from_millis(0)), &mut ()).unwrap(); | |
| control_flow = ControlFlow::default(); |
winit/src/platform_impl/linux/x11/mod.rs
Lines 289 to 291 in 0df4369
| ControlFlow::Wait => { | |
| self.inner_loop.dispatch(None, &mut ()).unwrap(); | |
| control_flow = ControlFlow::default(); |
winit/src/platform_impl/linux/x11/mod.rs
Lines 301 to 306 in 0df4369
| ControlFlow::WaitUntil(deadline) => { | |
| let start = ::std::time::Instant::now(); | |
| // compute the blocking duration | |
| let duration = deadline.duration_since(::std::cmp::max(deadline, start)); | |
| self.inner_loop.dispatch(Some(duration), &mut ()).unwrap(); | |
| control_flow = ControlFlow::default(); |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedD - easyLikely easier than most tasks hereLikely easier than most tasks hereDS - waylandAffects the Wayland backend, or generally free Unix platformsAffects the Wayland backend, or generally free Unix platformsDS - x11Affects the X11 backend, or generally free Unix platformsAffects the X11 backend, or generally free Unix platformsH - good first issueIdeal for new contributorsIdeal for new contributors