Search Issue Tracker

Won't Fix

Under Consideration for 2021.3.X, 2022.2.X, 2023.1.X

Votes

1

Found in

2020.3.42f1

2021.3.16f1

2022.2.1f1

2023.1.0a23

Issue ID

UUM-21611

Regression

No

The Player window keeps the old resolution while keeping the same window size for 2-4 frames when changing the resolution using Screen.SetResolution() function

--

-

Reproduction steps:

# Open the attached “aspect” project
# In the Assets folder open the ScreenHandler script and put the breakpoint on line 19 (Screen.SetResolution(…))
# In the Editor press File → Build Settings and add the “SampleScene” to “Scenes In Build”
# In the Build Settings window enable “Development Build”, “Script Debugging” and press Build And Run
# In Visual Studio press Debug → Attach Unity Debugger
# In the “Select Unity Instance” window select the entry with the “Player” Type
# In the Player press the “window” button
# In the Player press the “fullscreen” button
# Observe Visual Studio hitting the breakpoint
# With Visual Studio in focus hold the F10 (Step Over) until the Player window becomes fullscreen

Expected result: Resolution is set to the current screen resolution
Actual result: Resolution is not set to the current screen resolution, Player window has a distorted image

Reproducible with: 2020.3.43f1, 2021.3.16f1, 2022.2.1f1, 2023.1.0a23

Reproduced on: Windows 10

Note #1: Visual Studio was used to test this bug, but there’re reasons to believe that for testing this bug any IDE could be used.
Note #2: The issue is best pronounced when changing between very different aspect rations, for example going from 9:16 to 16:9.
Note #3: While holding F10 in the Visual Studio it would sometime show “Frame not in module”, however, this would not affect reproduction, the solution is simply to continue holding F10.

  1. Resolution Note:

    The issue is minor/cosmetic and there are no good solutions for syncing the window resize behavior to the actual frame rendering as the frames are rendered asynchronously.

    When the resize call comes in, there are already one or several frames queued for presentation with the old resolution of the window. Discarding the frames or delaying resize operation to account for it would both result in worse user experience. By either making it feel sluggish to resize a window or alternatively, having the window black when resizing as the frames would be discarded.
    In this case scaling of the graphics is the best compromise.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.