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

weird startup scaling issues on macOS after winit 0.30 #13702

Closed
tychedelia opened this issue Jun 6, 2024 · 4 comments · Fixed by #13967
Closed

weird startup scaling issues on macOS after winit 0.30 #13702

tychedelia opened this issue Jun 6, 2024 · 4 comments · Fixed by #13967
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 P-Regression Functionality that used to work but no longer does. Add a test for this!
Milestone

Comments

@tychedelia
Copy link
Contributor

See video here:

window.mp4

This probably doesn't need to be blocking for 0.14 but feels pretty gross.

@tychedelia tychedelia added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 6, 2024
@BD103 BD103 added A-Windowing Platform-agnostic interface layer to run your app in O-MacOS Specific to the MacOS (Apple) desktop operating system P-Regression Functionality that used to work but no longer does. Add a test for this! and removed S-Needs-Triage This issue needs to be labelled labels Jun 8, 2024
@rparrett
Copy link
Contributor

It seems like the initial render is at scale_factor 1.0 and updates to the correct scale factor on the next frame.

@rparrett
Copy link
Contributor

No surprise, but bisected to #13366

@alice-i-cecile
Copy link
Member

Yeah, strongly suspect we're not setting the initial value correctly. If y'all can figure out a fix, ping me and I'll merge it for 0.14.

@rparrett
Copy link
Contributor

rparrett commented Jun 21, 2024

I think that what is generally going on is:

  • We ask winit to create a window. We have no way of knowing what the scale factor is yet if we didn't override it.
  • winit creates it and sends a resize event with the correct size / scale factor
  • we don't respond to that event until a frame later.

I am not sure if this needs to be split off into a separate issue yet (will try to test on another platform), but I am also seeing scale_factor_override not yielding the correct window size. edit: this seems mac specific and probably related.

Adding

primary_window: Some(Window {
    resolution:
        bevy::window::WindowResolution::default().with_scale_factor_override(2.0), // something not-1.0
    ..default()
}),

Results in fonts becoming larger, but the window stays the same size. (forever, it never gets resized)

@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Jun 21, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 21, 2024
# Objective

- Fixes #13702
- When creating a new window, its scale was changed to match the one
returned by winit, but its size was not which resulted in an incorrect
size until the event with the correct size was received, at least 1
frame later

## Solution

- Apply the window scale to its size when creating it
mockersf added a commit that referenced this issue Jun 21, 2024
# Objective

- Fixes #13702
- When creating a new window, its scale was changed to match the one
returned by winit, but its size was not which resulted in an incorrect
size until the event with the correct size was received, at least 1
frame later

## Solution

- Apply the window scale to its size when creating it
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 P-Regression Functionality that used to work but no longer does. Add a test for this!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants