Skip to content

Commit

Permalink
Request a redraw when a window is resized
Browse files Browse the repository at this point in the history
If we do not request it, macOS does not get any
`RedrawRequested` events. Shouldn't `winit`
[take care of this]? Probably a bug.

[take care of this]: https://docs.rs/winit/0.30.5/winit/event/enum.WindowEvent.html#variant.RedrawRequested
  • Loading branch information
hecrj committed Oct 23, 2024
1 parent 1c4e4ce commit 3c260e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions winit/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,13 @@ async fn run_instance<P, C>(
continue;
};

if matches!(
window_event,
winit::event::WindowEvent::Resized(_)
) {
window.raw.request_redraw();
}

if matches!(
window_event,
winit::event::WindowEvent::CloseRequested
Expand Down

0 comments on commit 3c260e3

Please sign in to comment.