servoshell: Always use ControlFlow::Wait on winit (#40715)

Nowadays the renderer will always wake up the event loop when it needs
to paint
a new frame, so we can always use `ControlFlow::Wait`. This should be a
more efficient way to run animations.

Testing: This should not change behavior, but should make servoshell a
bit more
efficient.
Closes: #21855

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson
2025-11-18 15:54:03 +01:00
committed by GitHub
parent 403e3d49d0
commit 36005aab82

View File

@@ -626,11 +626,7 @@ impl ApplicationHandler<AppEvent> for App {
}
// Block until the window gets an event
if !self.animating() || self.suspended.get() {
event_loop.set_control_flow(ControlFlow::Wait);
} else {
event_loop.set_control_flow(ControlFlow::Poll);
}
event_loop.set_control_flow(ControlFlow::Wait);
// Consume and handle any events from the servoshell UI.
self.handle_servoshell_ui_events();