Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_physical_resolution broken on macOS after winit 0.30 #13701

Closed
tychedelia opened this issue Jun 6, 2024 · 0 comments · Fixed by #13942
Closed

set_physical_resolution broken on macOS after winit 0.30 #13701

tychedelia opened this issue Jun 6, 2024 · 0 comments · Fixed by #13942
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-MacOS Specific to the MacOS (Apple) desktop operating system
Milestone

Comments

@tychedelia
Copy link
Contributor

Reproduce here:

diff --git a/examples/window/multiple_windows.rs b/examples/window/multiple_windows.rs
index 18d17084d..4c6bd0bde 100644
--- a/examples/window/multiple_windows.rs
+++ b/examples/window/multiple_windows.rs
@@ -7,6 +7,7 @@ fn main() {
         // By default, a primary window gets spawned by `WindowPlugin`, contained in `DefaultPlugins`
         .add_plugins(DefaultPlugins)
         .add_systems(Startup, setup_scene)
+        .add_systems(Update, resize)
         .run();
 }
 
@@ -66,3 +67,18 @@ fn setup_scene(mut commands: Commands, asset_server: Res<AssetServer>) {
             ));
         });
 }
+
+
+fn resize(
+    input: Res<ButtonInput<KeyCode>>,
+    mut query: Query<(&mut Window)>) {
+
+    if input.just_pressed(KeyCode::Space) {
+        for (mut window) in query.iter_mut() {
+            info!("Resizing window");
+            window
+                .resolution
+                .set_physical_resolution(100, 200);
+        }
+    }
+}
\ No newline at end of file

image

The texture is resized in a weird way but the window is not.

@tychedelia tychedelia added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 6, 2024
@mnmaita mnmaita added A-Windowing Platform-agnostic interface layer to run your app in O-MacOS Specific to the MacOS (Apple) desktop operating system and removed S-Needs-Triage This issue needs to be labelled labels Jun 14, 2024
@BD103 BD103 added this to the 0.14 milestone Jun 17, 2024
tychedelia added a commit to tychedelia/bevy that referenced this issue Jun 20, 2024
tychedelia added a commit to tychedelia/bevy that referenced this issue Jun 20, 2024
tychedelia added a commit to tychedelia/bevy that referenced this issue Jun 20, 2024
tychedelia added a commit to tychedelia/bevy that referenced this issue Jun 20, 2024
tychedelia added a commit to tychedelia/bevy that referenced this issue Jun 20, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 20, 2024
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.
mockersf pushed a commit that referenced this issue Jun 21, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior O-MacOS Specific to the MacOS (Apple) desktop operating system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants