Skip update on RedrawRequested if not needed
This commit is contained in:
parent
859d6bb972
commit
7086fa2168
1 changed files with 45 additions and 42 deletions
|
|
@ -853,53 +853,56 @@ async fn run_instance<P>(
|
||||||
break state;
|
break state;
|
||||||
}
|
}
|
||||||
|
|
||||||
let caches: FxHashMap<_, _> =
|
if !messages.is_empty() {
|
||||||
ManuallyDrop::into_inner(user_interfaces)
|
let caches: FxHashMap<_, _> =
|
||||||
.into_iter()
|
ManuallyDrop::into_inner(user_interfaces)
|
||||||
.map(|(id, interface)| {
|
.into_iter()
|
||||||
(id, interface.into_cache())
|
.map(|(id, interface)| {
|
||||||
})
|
(id, interface.into_cache())
|
||||||
.collect();
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
let actions = update(
|
let actions = update(
|
||||||
&mut program,
|
&mut program,
|
||||||
&mut runtime,
|
|
||||||
&mut messages,
|
|
||||||
);
|
|
||||||
|
|
||||||
user_interfaces =
|
|
||||||
ManuallyDrop::new(build_user_interfaces(
|
|
||||||
&program,
|
|
||||||
&mut window_manager,
|
|
||||||
caches,
|
|
||||||
));
|
|
||||||
|
|
||||||
for action in actions {
|
|
||||||
run_action(
|
|
||||||
action,
|
|
||||||
&program,
|
|
||||||
&mut runtime,
|
&mut runtime,
|
||||||
&mut compositor,
|
|
||||||
&mut events,
|
|
||||||
&mut messages,
|
&mut messages,
|
||||||
&mut clipboard,
|
|
||||||
&mut control_sender,
|
|
||||||
&mut user_interfaces,
|
|
||||||
&mut window_manager,
|
|
||||||
&mut ui_caches,
|
|
||||||
&mut is_window_opening,
|
|
||||||
&mut system_theme,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
user_interfaces =
|
||||||
|
ManuallyDrop::new(build_user_interfaces(
|
||||||
|
&program,
|
||||||
|
&mut window_manager,
|
||||||
|
caches,
|
||||||
|
));
|
||||||
|
|
||||||
|
for action in actions {
|
||||||
|
run_action(
|
||||||
|
action,
|
||||||
|
&program,
|
||||||
|
&mut runtime,
|
||||||
|
&mut compositor,
|
||||||
|
&mut events,
|
||||||
|
&mut messages,
|
||||||
|
&mut clipboard,
|
||||||
|
&mut control_sender,
|
||||||
|
&mut user_interfaces,
|
||||||
|
&mut window_manager,
|
||||||
|
&mut ui_caches,
|
||||||
|
&mut is_window_opening,
|
||||||
|
&mut system_theme,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let Some(next_compositor) = compositor.as_mut()
|
||||||
|
else {
|
||||||
|
continue 'next_event;
|
||||||
|
};
|
||||||
|
|
||||||
|
current_compositor = next_compositor;
|
||||||
|
window = window_manager.get_mut(id).unwrap();
|
||||||
|
interface =
|
||||||
|
user_interfaces.get_mut(&id).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let Some(next_compositor) = compositor.as_mut()
|
|
||||||
else {
|
|
||||||
continue 'next_event;
|
|
||||||
};
|
|
||||||
|
|
||||||
current_compositor = next_compositor;
|
|
||||||
window = window_manager.get_mut(id).unwrap();
|
|
||||||
interface = user_interfaces.get_mut(&id).unwrap();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface.draw(
|
interface.draw(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue