UnityAspectRatioController
UnityAspectRatioController copied to clipboard
Unable to switch to full screen after changing size of window
Hello, Thanks a lot for this project.
However I noticed some issue : When at the start of my unity application I click on the rectangle icon of the top right hand corner to go to full screen it works. But when I click on that same rectangle after I have already changed my window resolution, it doesn't allow me to go to full screen anymore.
I am on Windows 10, and Unity 2019.4.15f1
I faced the same problem. This is due to the fact that the Windows "full screen" button is part of Aero Snap, for which I found a separate handler in the Update method in the code. Just comment or delete or remake for your task out this part of the code. else if (!Screen.fullScreen && setWidth != -1 && setHeight != -1 && (Screen.width != setWidth || Screen.height != setHeight)) { // Aero Snap detected. Set width by height. // Necessary because Aero Snap doesn't trigger WM_SIZING. setHeight = Screen.height; setWidth = Mathf.RoundToInt(Screen.height * aspect); Screen.SetResolution(setWidth, setHeight, Screen.fullScreen); resolutionChangedEvent.Invoke(setWidth, setHeight, Screen.fullScreen); }