From ad0523230eae06fbeab394b649fbbbbe4c80ad2c Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Thu, 10 Apr 2025 13:48:50 -0400 Subject: [PATCH] fix: reset control flow if the loop is about to wait with nothing to do. --- winit/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 309c83a1..00a96e63 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -1295,6 +1295,8 @@ async fn run_instance

( let skip = events.is_empty() && messages.is_empty(); if skip && window_manager.is_idle() { + _ = control_sender + .start_send(Control::ChangeFlow(ControlFlow::Wait)); continue; } @@ -1415,6 +1417,8 @@ async fn run_instance

( | core::Event::Mouse(_) ) { + _ = control_sender + .start_send(Control::ChangeFlow(ControlFlow::Wait)); continue; } runtime.broadcast(subscription::Event::Interaction {