Fix Mac Event Loop (#4753)

* Fix mac

* Format
This commit is contained in:
Connor Fitzgerald authored and GitHub committed 2023-11-22 15:50:12 -05:00
1 parent 039660ec85
commit eadd750412
1 file changed
+8
+8
View File
@@ -434,6 +434,14 @@ async fn start<E: Example>(title: &str) {
println!("{:#?}", context.instance.generate_report());
}
WindowEvent::RedrawRequested => {
// On MacOS, currently redraw requested comes in _before_ Init does.
// If this happens, just drop the requested redraw on the floor.
//
// See https://github.com/rust-windowing/winit/issues/3235 for some discussion
if example.is_none() {
return;
}
frame_counter.update();
let frame = surface.acquire(&context);