Skip to content

Commit 0108457

Browse files
committed
Always request redraw after timeout
1 parent e4566ef commit 0108457

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

desktop/src/app.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::thread;
66
use std::time::{Duration, Instant};
77
use winit::application::ApplicationHandler;
88
use winit::dpi::{PhysicalPosition, PhysicalSize};
9-
use winit::event::{ButtonSource, ElementState, MouseButton, WindowEvent};
9+
use winit::event::{ButtonSource, ElementState, MouseButton, StartCause, WindowEvent};
1010
use winit::event_loop::{ActiveEventLoop, ControlFlow, EventLoop};
1111
use winit::window::WindowId;
1212

@@ -636,6 +636,14 @@ impl ApplicationHandler for App {
636636
}
637637
}
638638

639+
fn new_events(&mut self, event_loop: &dyn ActiveEventLoop, cause: winit::event::StartCause) {
640+
if let StartCause::ResumeTimeReached { .. } = cause
641+
&& let Some(window) = &self.window
642+
{
643+
window.request_redraw();
644+
}
645+
}
646+
639647
fn about_to_wait(&mut self, event_loop: &dyn ActiveEventLoop) {
640648
// Set a timeout in case we miss any cef schedule requests
641649
let timeout = Instant::now() + Duration::from_millis(10);

0 commit comments

Comments
 (0)