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
- Longer Add Component submenu labels obscure UI and are not truncated
- Scripts submenu of the Add Component Menu can be scrolled horizontally
- Documentation link icons' are not aligned in he "Recommendation" tab
- "Game Specifications" section becomes blank, and users get "ArgumentException: Cannot unschedule unknown scheduled function" during the "Game Specification" selection when the "Multiplayer Center" window is docked
- Foldout arrow indent is misaligned in the Inspector when used in Custom Type
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.