mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 13:51:30 +11:00
x11/wayland: Don't reset control flow between loop ticks (#916)
This commit is contained in:
parent
412516159f
commit
9a11f90a02
|
@ -249,12 +249,10 @@ impl<T: 'static> EventLoop<T> {
|
|||
ControlFlow::Poll => {
|
||||
// non-blocking dispatch
|
||||
self.inner_loop.dispatch(Some(::std::time::Duration::from_millis(0)), &mut ()).unwrap();
|
||||
control_flow = ControlFlow::default();
|
||||
callback(::event::Event::NewEvents(::event::StartCause::Poll), &self.window_target, &mut control_flow);
|
||||
},
|
||||
ControlFlow::Wait => {
|
||||
self.inner_loop.dispatch(None, &mut ()).unwrap();
|
||||
control_flow = ControlFlow::default();
|
||||
callback(
|
||||
::event::Event::NewEvents(::event::StartCause::WaitCancelled {
|
||||
start: Instant::now(),
|
||||
|
@ -273,7 +271,6 @@ impl<T: 'static> EventLoop<T> {
|
|||
::std::time::Duration::from_millis(0)
|
||||
};
|
||||
self.inner_loop.dispatch(Some(duration), &mut ()).unwrap();
|
||||
control_flow = ControlFlow::default();
|
||||
let now = Instant::now();
|
||||
if now < deadline {
|
||||
callback(
|
||||
|
|
|
@ -283,12 +283,10 @@ impl<T: 'static> EventLoop<T> {
|
|||
ControlFlow::Poll => {
|
||||
// non-blocking dispatch
|
||||
self.inner_loop.dispatch(Some(::std::time::Duration::from_millis(0)), &mut ()).unwrap();
|
||||
control_flow = ControlFlow::default();
|
||||
callback(::event::Event::NewEvents(::event::StartCause::Poll), &self.target, &mut control_flow);
|
||||
},
|
||||
ControlFlow::Wait => {
|
||||
self.inner_loop.dispatch(None, &mut ()).unwrap();
|
||||
control_flow = ControlFlow::default();
|
||||
callback(
|
||||
::event::Event::NewEvents(::event::StartCause::WaitCancelled {
|
||||
start: ::std::time::Instant::now(),
|
||||
|
@ -307,7 +305,6 @@ impl<T: 'static> EventLoop<T> {
|
|||
::std::time::Duration::from_millis(0)
|
||||
};
|
||||
self.inner_loop.dispatch(Some(duration), &mut ()).unwrap();
|
||||
control_flow = ControlFlow::default();
|
||||
let now = std::time::Instant::now();
|
||||
if now < deadline {
|
||||
callback(
|
||||
|
|
Loading…
Reference in a new issue