Fix reset to Poll after the event loop starts
This commit is contained in:
parent
0960635895
commit
42c9b7e40e
9 changed files with 13 additions and 40 deletions
|
|
@ -526,7 +526,6 @@ impl<T: 'static> EventLoop<T> {
|
|||
// than once
|
||||
self.pending_redraw = false;
|
||||
self.cause = StartCause::Init;
|
||||
self.set_control_flow(ControlFlow::default());
|
||||
|
||||
// run the initial loop iteration
|
||||
self.single_iteration(None, &mut callback);
|
||||
|
|
@ -637,10 +636,6 @@ impl<T: 'static> EventLoop<T> {
|
|||
}
|
||||
}
|
||||
|
||||
fn set_control_flow(&self, control_flow: ControlFlow) {
|
||||
self.window_target.p.set_control_flow(control_flow)
|
||||
}
|
||||
|
||||
fn control_flow(&self) -> ControlFlow {
|
||||
self.window_target.p.control_flow()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ impl AppState {
|
|||
};
|
||||
self.set_state(AppStateImpl::ProcessingEvents {
|
||||
event_handler,
|
||||
active_control_flow: ControlFlow::Poll,
|
||||
active_control_flow: self.control_flow,
|
||||
queued_gpu_redraws,
|
||||
});
|
||||
(windows, events)
|
||||
|
|
@ -523,11 +523,6 @@ pub fn did_finish_launching(mtm: MainThreadMarker) {
|
|||
s => bug!("unexpected state {:?}", s),
|
||||
};
|
||||
|
||||
// start waking up the event loop now!
|
||||
bug_assert!(
|
||||
this.control_flow == ControlFlow::Poll,
|
||||
"unexpectedly not setup to `Poll` on launch!"
|
||||
);
|
||||
this.waker.start();
|
||||
|
||||
// have to drop RefMut because the window setup code below can trigger new events
|
||||
|
|
|
|||
|
|
@ -227,11 +227,6 @@ impl<T: 'static> EventLoop<T> {
|
|||
if !self.loop_running {
|
||||
self.loop_running = true;
|
||||
|
||||
// Reset the internal state for the loop as we start running to
|
||||
// ensure consistent behaviour in case the loop runs and exits more
|
||||
// than once.
|
||||
self.set_control_flow(ControlFlow::Poll);
|
||||
|
||||
// Run the initial loop iteration.
|
||||
self.single_iteration(&mut callback, StartCause::Init);
|
||||
}
|
||||
|
|
@ -611,10 +606,6 @@ impl<T: 'static> EventLoop<T> {
|
|||
})
|
||||
}
|
||||
|
||||
fn set_control_flow(&self, control_flow: ControlFlow) {
|
||||
self.window_target.p.set_control_flow(control_flow)
|
||||
}
|
||||
|
||||
fn control_flow(&self) -> ControlFlow {
|
||||
self.window_target.p.control_flow()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -439,11 +439,6 @@ impl<T: 'static> EventLoop<T> {
|
|||
if !self.loop_running {
|
||||
self.loop_running = true;
|
||||
|
||||
// Reset the internal state for the loop as we start running to
|
||||
// ensure consistent behaviour in case the loop runs and exits more
|
||||
// than once.
|
||||
self.set_control_flow(ControlFlow::Poll);
|
||||
|
||||
// run the initial loop iteration
|
||||
self.single_iteration(&mut callback, StartCause::Init);
|
||||
}
|
||||
|
|
@ -646,10 +641,6 @@ impl<T: 'static> EventLoop<T> {
|
|||
}
|
||||
}
|
||||
|
||||
fn set_control_flow(&self, control_flow: ControlFlow) {
|
||||
self.target.p.set_control_flow(control_flow)
|
||||
}
|
||||
|
||||
fn control_flow(&self) -> ControlFlow {
|
||||
self.target.p.control_flow()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,7 +199,6 @@ impl Handler {
|
|||
// looks like there have been recuring re-entrancy issues with callback handling that might
|
||||
// make that awkward)
|
||||
self.running.store(false, Ordering::Relaxed);
|
||||
*self.control_flow.lock().unwrap() = ControlFlow::default();
|
||||
self.set_stop_app_on_redraw_requested(false);
|
||||
self.set_stop_app_before_wait(false);
|
||||
self.set_stop_app_after_wait(false);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ impl<T> EventLoopRunner<T> {
|
|||
interrupt_msg_dispatch,
|
||||
runner_state,
|
||||
panic_error,
|
||||
control_flow,
|
||||
control_flow: _,
|
||||
exit,
|
||||
last_events_cleared: _,
|
||||
event_handler,
|
||||
|
|
@ -124,7 +124,6 @@ impl<T> EventLoopRunner<T> {
|
|||
interrupt_msg_dispatch.set(false);
|
||||
runner_state.set(RunnerState::Uninitialized);
|
||||
panic_error.set(None);
|
||||
control_flow.set(ControlFlow::default());
|
||||
exit.set(None);
|
||||
event_handler.set(None);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue