Skip to content

Commit 20ed3e0

Browse files
corehptxmac
andauthored
macOS Sonoma (14.0) / Xcode 15.0 — Compatibility Fixes + Docs (#9905)
# Objective Improve compatibility with macOS Sonoma and Xcode 15.0. ## Solution - Adds the workaround by @ptxmac to ignore the invalid window sizes provided by `winit` on macOS 14.0 - This still provides a slightly wrong content size when resizing (it fails to account for the window title bar, so some content gets clipped at the bottom) but it's _much better_ than crashing. - Adds docs on how to work around the `bindgen` bug on Xcode 15.0. ## Related Issues: - RustAudio/coreaudio-sys#85 - rust-windowing/winit#2876 --- ## Changelog - Added a workaround for a `winit`-related crash under macOS Sonoma (14.0) --------- Co-authored-by: Peter Kristensen <[email protected]>
1 parent b6ead2b commit 20ed3e0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/bevy_winit/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,14 @@ pub fn winit_runner(mut app: App) {
441441

442442
match event {
443443
WindowEvent::Resized(size) => {
444+
// TODO: Remove this once we upgrade winit to a version with the fix
445+
#[cfg(target_os = "macos")]
446+
if size.width == u32::MAX || size.height == u32::MAX {
447+
// HACK to fix a bug on Macos 14
448+
// https://github.com/rust-windowing/winit/issues/2876
449+
return;
450+
}
451+
444452
window
445453
.resolution
446454
.set_physical_resolution(size.width, size.height);

0 commit comments

Comments
 (0)