mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-02 12:58:23 +00:00
GL backend: don't force every window to be redrawn in case of animation
When the animation tick occurs, the tracker will tell winit to repaint the relevant window already.
This commit is contained in:
parent
bd44afdbf4
commit
575665994a
1 changed files with 2 additions and 3 deletions
|
|
@ -323,6 +323,7 @@ impl std::fmt::Debug for CustomEvent {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn redraw_all_windows() {
|
||||
let all_windows_weak =
|
||||
ALL_WINDOWS.with(|windows| windows.borrow().values().cloned().collect::<Vec<_>>());
|
||||
|
|
@ -608,6 +609,7 @@ pub fn run(quit_behavior: i_slint_core::backend::EventLoopQuitBehavior) {
|
|||
}
|
||||
|
||||
winit::event::Event::MainEventsCleared => {
|
||||
corelib::timers::TimerList::maybe_activate_timers();
|
||||
corelib::animations::update_animations();
|
||||
}
|
||||
_ => (),
|
||||
|
|
@ -618,11 +620,8 @@ pub fn run(quit_behavior: i_slint_core::backend::EventLoopQuitBehavior) {
|
|||
.with(|driver| driver.has_active_animations())
|
||||
{
|
||||
*control_flow = ControlFlow::Poll;
|
||||
redraw_all_windows()
|
||||
}
|
||||
|
||||
corelib::timers::TimerList::maybe_activate_timers();
|
||||
|
||||
if *control_flow == winit::event_loop::ControlFlow::Wait {
|
||||
if let Some(next_timer) = corelib::timers::TimerList::next_timeout() {
|
||||
*control_flow = winit::event_loop::ControlFlow::WaitUntil(next_timer.into());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue