Skip to content

Commit

Permalink
Fix winit resize event on macOS 14 (bevyengine#9905)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptxmac authored and mockersf committed Sep 27, 2023
1 parent 12c6fa7 commit df43c17
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,14 @@ pub fn winit_runner(mut app: App) {

match event {
WindowEvent::Resized(size) => {
// TODO: Remove this once we upgrade winit to a version with the fix
#[cfg(target_os = "macos")]
if size.width == u32::MAX || size.height == u32::MAX {
// HACK to fix a bug on Macos 14
// https://github.com/rust-windowing/winit/issues/2876
return;
}

window
.resolution
.set_physical_resolution(size.width, size.height);
Expand Down

0 comments on commit df43c17

Please sign in to comment.