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
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
- White lighting artifact when a point light with a small emission range and "Hard Shadows" touches an object while a directional light with "Soft Shadows" and another point light are present
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.