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
- Shader Compilation for projects with lots of Shaders can be slow (i.e. VFX Graph asset heavy projects)
- Crash on RebuildTransformHierarchyOrMarkForDestruction when opening a scene
- The Editor hangs when opening a project that uses local packages and Version Control
- Area Light is culled when Camera Frustrum is outside the lights range
- The characters of the bottom option in the Scene View Debug Draw Mode dropdown menu are cut off
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.