diff options
author | 2023-02-21 16:46:32 -0800 | |
---|---|---|
committer | 2023-02-22 10:05:52 -0800 | |
commit | 50b9c778b1e49fc83f827a340dce36a09bb291d6 (patch) | |
tree | a2685bc6de916af693a4842b646c0660757a467d /winit/src/multi_window.rs | |
parent | bd58d5fe25182908e99fdb0ced07b86666e45081 (diff) | |
download | iced-50b9c778b1e49fc83f827a340dce36a09bb291d6.tar.gz iced-50b9c778b1e49fc83f827a340dce36a09bb291d6.tar.bz2 iced-50b9c778b1e49fc83f827a340dce36a09bb291d6.zip |
Fixed state syncing issue with MW.
Diffstat (limited to '')
-rw-r--r-- | winit/src/multi_window.rs | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/winit/src/multi_window.rs b/winit/src/multi_window.rs index 788f39f7..1a9d4a1c 100644 --- a/winit/src/multi_window.rs +++ b/winit/src/multi_window.rs @@ -502,12 +502,16 @@ async fn run_instance<A, E, C>( || compositor.fetch_information(), ); - // synchronize window state with application state. - states.get_mut(&id).unwrap().synchronize( - &application, - id, - windows.get(&id).expect("No window found with ID."), - ); + // synchronize window states with application states. + for (id, state) in states.iter_mut() { + state.synchronize( + &application, + *id, + windows + .get(id) + .expect("No window found with ID."), + ); + } interfaces = ManuallyDrop::new(build_user_interfaces( &application, @@ -575,20 +579,19 @@ async fn run_instance<A, E, C>( crate::event::Status::Ignored, )); - let _ = - control_sender.start_send(match interface_state { - user_interface::State::Updated { - redraw_request: Some(redraw_request), - } => match redraw_request { - window::RedrawRequest::NextFrame => { - ControlFlow::Poll - } - window::RedrawRequest::At(at) => { - ControlFlow::WaitUntil(at) - } - }, - _ => ControlFlow::Wait, - }); + let _ = control_sender.start_send(match interface_state { + user_interface::State::Updated { + redraw_request: Some(redraw_request), + } => match redraw_request { + window::RedrawRequest::NextFrame => { + ControlFlow::Poll + } + window::RedrawRequest::At(at) => { + ControlFlow::WaitUntil(at) + } + }, + _ => ControlFlow::Wait, + }); redraw_pending = false; } |