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: - https://github.com/RustAudio/coreaudio-sys/issues/85 - https://github.com/rust-windowing/winit/issues/2876 --- ## Changelog - Added a workaround for a `winit`-related crash under macOS Sonoma (14.0) --------- Co-authored-by: Peter Kristensen <peter@ptx.dk>
This commit is contained in:
parent
b6ead2be95
commit
20ed3e0e76
@ -441,6 +441,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);
|
||||
|
Loading…
Reference in New Issue
Block a user