From 9a11f90a02cdca98d98ef625938e4580b2c5bdab Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Thu, 13 Jun 2019 18:52:10 +0200 Subject: [PATCH] x11/wayland: Don't reset control flow between loop ticks (#916) --- src/platform_impl/linux/wayland/event_loop.rs | 3 --- src/platform_impl/linux/x11/mod.rs | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/platform_impl/linux/wayland/event_loop.rs b/src/platform_impl/linux/wayland/event_loop.rs index 23deb87d..eddfa8e7 100644 --- a/src/platform_impl/linux/wayland/event_loop.rs +++ b/src/platform_impl/linux/wayland/event_loop.rs @@ -249,12 +249,10 @@ impl EventLoop { 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 EventLoop { ::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( diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs index 5339bef2..6064a482 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -283,12 +283,10 @@ impl EventLoop { 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 EventLoop { ::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(