From 6c93efa2a969f9b3ee0090a2d6fe294d22a56095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 16 Oct 2025 17:02:23 +0200 Subject: [PATCH] Fix `window::resize` during `RedrawRequested` events --- winit/src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 73f22aa2..57b5a6a1 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -878,7 +878,20 @@ async fn run_instance

( caches, )); + let mut has_window_resized = false; + for action in actions { + has_window_resized = has_window_resized + || matches!( + action, + Action::Window( + runtime::window::Action::Resize( + _, + _ + ) + ) + ); + run_action( action, &program, @@ -905,6 +918,11 @@ async fn run_instance

( window = window_manager.get_mut(id).unwrap(); interface = user_interfaces.get_mut(&id).unwrap(); + + if has_window_resized { + window.raw.request_redraw(); + continue 'next_event; + } } };