Defer window::Action during RedrawRequested
This commit is contained in:
parent
f7425db87e
commit
f0be63517f
1 changed files with 10 additions and 16 deletions
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue