Skip to content

Commit

Permalink
made redraw_events_cleared more explicit and more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
filnet committed Mar 6, 2020
1 parent 46bdec5 commit e145f74
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/platform_impl/windows/event_loop/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ impl<T> EventLoopRunner<T> {
self.runner_state = RunnerState::HandlingRedraw;
}

// we already cleared the main events, we don't have to do anything.
// We already cleared the main events, we don't have to do anything.
// This happens when process_events() processed a RedrawRequested event.
RunnerState::HandlingRedraw => {}

// If we *weren't* handling events, we don't have to do anything.
Expand Down Expand Up @@ -443,9 +444,13 @@ impl<T> EventLoopRunner<T> {
self.call_event_handler(Event::RedrawEventsCleared);
self.runner_state = RunnerState::Idle(Instant::now());
}

// If we *weren't* handling redraws, we don't have to do anything.
_ => (),
// No event was processed, we don't have to do anything.
RunnerState::DeferredNewEvents(_) => (),
// Should not happen.
_ => warn!(
"unexpected state in redraw_events_cleared: {:?}",
self.runner_state
),
}
}

Expand Down

0 comments on commit e145f74

Please sign in to comment.