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,
));
let mut has_window_resized = false;
for action in actions {
if let Action::Window(
runtime::window::Action::Resize(
window_id,
_,
),
) = action
&& window_id == id
{
has_window_resized = true;
// Defer all window actions to avoid compositor
// race conditions while redrawing
if let Action::Window(_) = action {
runtime.run(
futures::futures::stream::once(
async move { action },
)
.boxed(),
);
continue;
}
run_action(
@ -929,11 +928,6 @@ async fn run_instance<P>(
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;
}
}
};