From 7908b6eba91b91c61f7839b3d52fbee124b55cc4 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 23 Oct 2024 19:37:28 +0200 Subject: 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 --- winit/src/program.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'winit') diff --git a/winit/src/program.rs b/winit/src/program.rs index a6729fa0..fb30ccd9 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -995,6 +995,13 @@ async fn run_instance( continue; }; + if matches!( + window_event, + winit::event::WindowEvent::Resized(_) + ) { + window.raw.request_redraw(); + } + if matches!( window_event, winit::event::WindowEvent::CloseRequested -- cgit