-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
When a menu from the menubar is visible/open on Windows, the main event loops stops processing. To reproduce, apply the following patch to the winit.rs example:
diff --git a/examples/winit.rs b/examples/winit.rs
index 1911bae..9fba310 100644
--- a/examples/winit.rs
+++ b/examples/winit.rs
@@ -141,6 +141,10 @@ impl ApplicationHandler<AppEvent> for App {
self.use_window_pos = !self.use_window_pos;
}
+ WindowEvent::RedrawRequested => {
+ eprintln!("redraw {:#?}", std::time::Instant::now());
+ }
+
_ => {}
}
}
@@ -157,6 +161,15 @@ impl ApplicationHandler<AppEvent> for App {
}
}
}
+
+ fn about_to_wait(&mut self, event_loop: &ActiveEventLoop) {
+ for (_, window) in &self.windows {
+ window.request_redraw();
+ }
+ event_loop.set_control_flow(winit::event_loop::ControlFlow::WaitUntil(
+ std::time::Instant::now() + std::time::Duration::from_millis(16),
+ ));
+ }
}
struct AppMenu {Observe how every 16 ms the redraw message is printed, but that stops when a menu from the menubar is opened.
philpax
Metadata
Metadata
Assignees
Labels
No labels