mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 13:31:29 +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 => {
|
ControlFlow::Poll => {
|
||||||
// non-blocking dispatch
|
// non-blocking dispatch
|
||||||
self.inner_loop.dispatch(Some(::std::time::Duration::from_millis(0)), &mut ()).unwrap();
|
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);
|
callback(::event::Event::NewEvents(::event::StartCause::Poll), &self.window_target, &mut control_flow);
|
||||||
},
|
},
|
||||||
ControlFlow::Wait => {
|
ControlFlow::Wait => {
|
||||||
self.inner_loop.dispatch(None, &mut ()).unwrap();
|
self.inner_loop.dispatch(None, &mut ()).unwrap();
|
||||||
control_flow = ControlFlow::default();
|
|
||||||
callback(
|
callback(
|
||||||
::event::Event::NewEvents(::event::StartCause::WaitCancelled {
|
::event::Event::NewEvents(::event::StartCause::WaitCancelled {
|
||||||
start: Instant::now(),
|
start: Instant::now(),
|
||||||
|
@ -273,7 +271,6 @@ impl<T: 'static> EventLoop<T> {
|
||||||
::std::time::Duration::from_millis(0)
|
::std::time::Duration::from_millis(0)
|
||||||
};
|
};
|
||||||
self.inner_loop.dispatch(Some(duration), &mut ()).unwrap();
|
self.inner_loop.dispatch(Some(duration), &mut ()).unwrap();
|
||||||
control_flow = ControlFlow::default();
|
|
||||||
let now = Instant::now();
|
let now = Instant::now();
|
||||||
if now < deadline {
|
if now < deadline {
|
||||||
callback(
|
callback(
|
||||||
|
|
|
@ -283,12 +283,10 @@ impl<T: 'static> EventLoop<T> {
|
||||||
ControlFlow::Poll => {
|
ControlFlow::Poll => {
|
||||||
// non-blocking dispatch
|
// non-blocking dispatch
|
||||||
self.inner_loop.dispatch(Some(::std::time::Duration::from_millis(0)), &mut ()).unwrap();
|
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);
|
callback(::event::Event::NewEvents(::event::StartCause::Poll), &self.target, &mut control_flow);
|
||||||
},
|
},
|
||||||
ControlFlow::Wait => {
|
ControlFlow::Wait => {
|
||||||
self.inner_loop.dispatch(None, &mut ()).unwrap();
|
self.inner_loop.dispatch(None, &mut ()).unwrap();
|
||||||
control_flow = ControlFlow::default();
|
|
||||||
callback(
|
callback(
|
||||||
::event::Event::NewEvents(::event::StartCause::WaitCancelled {
|
::event::Event::NewEvents(::event::StartCause::WaitCancelled {
|
||||||
start: ::std::time::Instant::now(),
|
start: ::std::time::Instant::now(),
|
||||||
|
@ -307,7 +305,6 @@ impl<T: 'static> EventLoop<T> {
|
||||||
::std::time::Duration::from_millis(0)
|
::std::time::Duration::from_millis(0)
|
||||||
};
|
};
|
||||||
self.inner_loop.dispatch(Some(duration), &mut ()).unwrap();
|
self.inner_loop.dispatch(Some(duration), &mut ()).unwrap();
|
||||||
control_flow = ControlFlow::default();
|
|
||||||
let now = std::time::Instant::now();
|
let now = std::time::Instant::now();
|
||||||
if now < deadline {
|
if now < deadline {
|
||||||
callback(
|
callback(
|
||||||
|
|
Loading…
Reference in a new issue