message: Process events only when necessary
  Additionally, this also fixes a bug where the old size was being used
  for layouting after a resize.
diff: @@ -110,7 +110,7 @@ pub trait Application: Sized {
  let dpi = window.hidpi_factor();
  let mut size = window.inner_size();
  - let mut new_size: Option<winit::dpi::LogicalSize> = None;
  + let mut resized = false;
  let mut renderer = Self::Renderer::new();
  @@ -143,6 +143,11 @@ pub trait Application: Sized {
  event_loop.run(move |event, _, control_flow| match event {
  event::Event::MainEventsCleared => {
  + if events.is_empty() && external_messages.is_empty() && !resized
  + {
  + return;
  + }
  +
  // TODO: We should be able to keep a user interface alive
  // between events once we remove state references.
  //
  @@ -217,9 +222,9 @@ pub trait Application: Sized {
  event::Event::RedrawRequested(_) => {
  debug.render_started();
  - if let Some(new_size) = new_size.take() {
  + if resized {
  let dpi = window.hidpi_factor();
  - let (width, height) = to_physical(new_size, dpi);
  + let (width, height) = to_physical(size, dpi);
  target.resize(
  width,
  @@ -228,7 +233,7 @@ pub trait Application: Sized {
  &renderer,
  );
  - size = new_size;
  + resized = false;
  }
  let new_mouse_cursor =
  @@ -320,8 +325,9 @@ pub trait Application: Sized {
  WindowEvent::CloseRequested => {
  *control_flow = ControlFlow::Exit;
  }
  - WindowEvent::Resized(size) => {
  - new_size = Some(size.into());
  + WindowEvent::Resized(new_size) => {
  + size = new_size;
  + resized = true;
  log::debug!("Resized: {:?}", new_size);
  }
  