Fix winit resize event on macOS 14 (#9905)

Co-Authored-By: Marco Buono <418473+coreh@users.noreply.github.com>
This commit is contained in:
Peter Kristensen 2023-08-27 16:02:18 +02:00 committed by François
parent 12c6fa7e59
commit e396f11e9d

View file

@ -435,6 +435,14 @@ pub fn winit_runner(mut app: App) {
match event { match event {
WindowEvent::Resized(size) => { 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 window
.resolution .resolution
.set_physical_resolution(size.width, size.height); .set_physical_resolution(size.width, size.height);