Search Issue Tracker
By Design
Votes
0
Found in
2018.2.0a6
2018.4
2019.2
2019.3
2019.3.0b6
2020.1
Issue ID
1191036
Regression
Yes
Screen.dpi is not consistent in the Editor when using multiple screens with different dpi scalings
Reproduction steps:
1. Make sure to have screens with different DPI scalings
2. Open the attached project named "Case_1191036"
3. Enter Play mode
4. Click between Unity windows in different screens
5. Observe the console window
Expected result: dpi reports consistent dpi reading
Actual result: dpi is changing whenever the mouse is moved inside one of the windows
Reproducible with: 2018.2.0a6, 2018.4.12f1, 2019.2.11f1, 2019.3.0b9, 2020.1.0a11
Not reproducible with: 2017.4.34f1, 2018.2.0a5
Notes:
To reproduce the issue monitors with different resolutions can be used (4k and 1080p). If monitor resolution is the same, changing the Windows DPI settings for one of the screens will also reproduce the issue.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Placeholder asset is not loaded with Advertisement Legacy sample when using the latest version of the package
- Addressables content build fails but the Player build is successful when building a development build
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
Resolution Note:
Since high dpi support was introduced in 18.2, Screen.dpi contains the dpi value for the last window that was rendered.
When the game runs, it's constant since the game has only one window, however, in the editor, you might see changes in value like this.
The only time You can be assured that Screen.dpi (or EditorGUIUtility.pixelsPerPoint) are referring to the current GameView window's dpi scaling values is during the OnGUI() method.