Skip to content

Commit

Permalink
Fix Mac Event Loop (#4753)
Browse files Browse the repository at this point in the history
* Fix mac

* Format
  • Loading branch information
cwfitzgerald authored Nov 22, 2023
1 parent 039660e commit eadd750
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/common/src/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eadd750

Please sign in to comment.