Request a redraw when a window is resized

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
This commit is contained in:
Héctor Ramón Jiménez 2024-10-23 19:37:28 +02:00
parent 46017c6483
commit 7908b6eba9
No known key found for this signature in database
GPG key ID: 4C07CEC81AFA161F

View file

@ -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