From e73063e1d5b9078f3d2b5ab8b42d1a8b446bdfd8 Mon Sep 17 00:00:00 2001 From: charlotte Date: Thu, 20 Jun 2024 04:22:47 -0700 Subject: [PATCH] Correctly check physical size when updating winit (#13942) Fixes #13701 After `winit` upgrade to `0.31`, windows were no longer correctly resizing. This appears to just have been a simple mistake, where the new physical size was being sourced from the `winit` window rather than on the incoming `Window` component. ## Testing Tested on macOS, but I'm curious whether this was also broken on other platforms. --- crates/bevy_winit/src/system.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/bevy_winit/src/system.rs b/crates/bevy_winit/src/system.rs index 48b0a5ef6e..3f12b34c41 100644 --- a/crates/bevy_winit/src/system.rs +++ b/crates/bevy_winit/src/system.rs @@ -223,7 +223,10 @@ pub(crate) fn changed_windows( } if window.resolution != cache.window.resolution { - let mut physical_size = winit_window.inner_size(); + let mut physical_size = PhysicalSize::new( + window.resolution.physical_width(), + window.resolution.physical_height(), + ); let cached_physical_size = PhysicalSize::new( cache.window.physical_width(),