x11/wayland: Don't reset control flow between loop ticks (#916)

This commit is contained in:
Victor Berger 2019-06-13 18:52:10 +02:00 committed by Osspial
parent 412516159f
commit 9a11f90a02
2 changed files with 0 additions and 6 deletions

View file

@ -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(

View file

@ -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(