Using UWP build, when running on Win10 desktop
When Calling Screen.SetResolution in Unity, on visual studio console log alway return false
When calling ApplicationView.TryResizeView on UI thread, it is nothing happen. So it is false to resize.
On Microsoft website
I think the app is running in Tablet Mode, so it false to resize.
But no mater calling
Screen.fullScreen = false in Unity
or
ApplicationView.ExitFullScreenMode() in UI thread
All are no use.
How can I manually control the window size?
I don’t think you can quit fullscreen in tablet mode. Changing resolution with Screen.SetResolution should work, though.
I think you a misunderstand my question, my meaning is Screen.SetResolution is not function on UWP, when running in Windows 10 PC desktop. It seems Unity is fixed the app in Tablet mode, not allow us to control the resolution by program code.
When using standalone build Screen.SetResolution is functioning. But when using UWP build it is not working.
Can you show the code you’re using?
I found there is a Bug on Unity, so why I call Screen.SetResolution not work when using Win10 UWP.
In my case, my monitor resolution is 1920x1080. So if I call Screen.SetResolution(768,1024,false) should work. But my case is not working.
When I change to use Screen.SetResolution(800,600,false). It work, but the window size is larger than I expected.
So I use Screen.width, Screen.height to see, the values are 1000 and 750.
It is not functioning previously, because of the value is too large!. In Unity, there is some scaling on it. Not 1:1, But the scale factor is unknown, is it vary from different monitor or resolution who known?
When using Standalone build it work perfect, no problem on it.
That looks like a serious bug. What are your DPI settings? Do you mind submitting a bug report on this with a repro project?
I don’t know how to create bug report on your system, I attach the project file. In case you can reproduce it.
On my PC using Screen.dpi, it show 141.
2935311–217108–TestScreen.zip (2.5 MB)
Is it confirm, it is a Bug?
Yes. I filled a bug report (case 875849).
Worth noting, this bug does not manifest if you are changing resolution in fullscreen (that is, when the last argument to Screen.SetResolution is true).
The fix for this issue landed to 5.5.3p1, which is supposed to go out next week.