Fix window::resize during RedrawRequested events
This commit is contained in:
parent
0b78f2aa5d
commit
6c93efa2a9
1 changed files with 18 additions and 0 deletions
|
|
@ -878,7 +878,20 @@ async fn run_instance<P>(
|
||||||
caches,
|
caches,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
let mut has_window_resized = false;
|
||||||
|
|
||||||
for action in actions {
|
for action in actions {
|
||||||
|
has_window_resized = has_window_resized
|
||||||
|
|| matches!(
|
||||||
|
action,
|
||||||
|
Action::Window(
|
||||||
|
runtime::window::Action::Resize(
|
||||||
|
_,
|
||||||
|
_
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
run_action(
|
run_action(
|
||||||
action,
|
action,
|
||||||
&program,
|
&program,
|
||||||
|
|
@ -905,6 +918,11 @@ 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