Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Mac Event Loop #4753

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading