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

This commit is contained in:
Victor Berger authored and Osspial committed 2019-06-13 12:52:10 -04:00
1 parent 412516159f
commit 9a11f90a02
2 files changed
-6

No files matched your search

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