diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 57b5a6a1..9e690783 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -881,16 +881,16 @@ async fn run_instance
( let mut has_window_resized = false; for action in actions { - has_window_resized = has_window_resized - || matches!( - action, - Action::Window( - runtime::window::Action::Resize( - _, - _ - ) - ) - ); + if let Action::Window( + runtime::window::Action::Resize( + window_id, + _, + ), + ) = action + && window_id == id + { + has_window_resized = true; + } run_action( action, @@ -909,6 +909,17 @@ async fn run_instance
( ); } + for (window_id, window) in + window_manager.iter_mut() + { + // We are already redrawing this window + if window_id == id { + continue; + } + + window.raw.request_redraw(); + } + let Some(next_compositor) = compositor.as_mut() else { continue 'next_event; @@ -1202,6 +1213,10 @@ async fn run_instance
( &mut system_theme, ); } + + for (_id, window) in window_manager.iter_mut() { + window.raw.request_redraw(); + } } if let Some(redraw_at) = window_manager.redraw_at() { @@ -1731,7 +1746,6 @@ where { for (id, window) in window_manager.iter_mut() { window.state.synchronize(program, id, &window.raw); - window.raw.request_redraw(); } debug::theme_changed(|| {