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
- Opening Terrain Prefab in Prefab Editing Mode throws "NullReferenceException" error
- [Search] Dragging query pills put them behind the search text field
- A CustomPropertyDrawer that returns a PropertyField for a property named the same as a child field will not render all child fields
- Graphics Settings shows default values instead of the real values in the Rendering Debugger when Volume.profile is assigned via script
- Deleting multiple Tags throws “NullReferenceException”, and "Retrieving array element that was out of bounds" errors when holding the Enter key
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.