Skip to content

Commit

Permalink
Correctly check physical size when updating winit (#13942)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tychedelia authored Jun 20, 2024
1 parent 2f9c42b commit 8635a0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/bevy_winit/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 8635a0f

Please sign in to comment.