Defer window::Action during RedrawRequested

This commit is contained in:
Héctor Ramón Jiménez 2025-10-16 18:42:57 +02:00
parent f7425db87e
commit f0be63517f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -878,18 +878,17 @@ async fn run_instance<P>(
caches, caches,
)); ));
let mut has_window_resized = false;
for action in actions { for action in actions {
if let Action::Window( // Defer all window actions to avoid compositor
runtime::window::Action::Resize( // race conditions while redrawing
window_id, if let Action::Window(_) = action {
_, runtime.run(
), futures::futures::stream::once(
) = action async move { action },
&& window_id == id )
{ .boxed(),
has_window_resized = true; );
continue;
} }
run_action( run_action(
@ -929,11 +928,6 @@ async fn run_instance<P>(
window = window_manager.get_mut(id).unwrap(); window = window_manager.get_mut(id).unwrap();
interface = interface =
user_interfaces.get_mut(&id).unwrap(); user_interfaces.get_mut(&id).unwrap();
if has_window_resized {
window.raw.request_redraw();
continue 'next_event;
}
} }
}; };