Troubleshooting IDE scaling (DPI) issues on Windows

IDE versions 2017.2 run in the new JRE-managed HiDPI mode on MS Windows 8.1/10. This aims at providing better IDE UI scaling, especially in a multi-monitor configuration with different DPI values. However, currently the new HiDPI mode is limited to integral scale values only. Because of that, IDE auto-switches to the previous IDE-managed HiDPI mode once it detects a fractional scale monitor on start. The switch between the HiDPI modes (per-monitor-DPI-aware to system-DPI-aware in terms of WinAPI) may cause UI issues. UI scaling issues may also appear in the following cases:

  • IDE starts on an integral scale monitor (or a number of monitors) but then a fractional scale monitor is plugged in
  • The system wakes up from sleep
  • IDE is used via RDP (Remote Desktop)
  • Monitors are connected via a docking station.

In order to try to resolve those issues, the following actions may help (some or all):

  • Restart IDE
  • Logout/login a Windows session (in case a monitor scale factor has been manually changed)
  • Change the IDE font size (Settings > Appearance & Behavior > Appearance > Override default fonts). It affects the IDE scale. If it helps, set the Editor font size appropriately (Settings > Editor > Color Scheme > Color Scheme Font)
  • Disable display scaling on high DPI settings.

If nothing of the above helps, it's recommended to manually set the IDE-managed HiDPI mode to prevent the auto-switch. For that, the following VM option should be set:

-Dsun.java2d.uiScale.enabled=false
6 comments

Came here by clicking on the troubleshoot scaling issues warning bubble in RubyMine. This is what worked for me on RubyMine in Windows 10 (the "Override high DPI scaling behavior" setting):

Edited by Dibyo Majumdar
3

@Dibyo Majumdar   This works perfectly, just let system to scale it if IDEA cant ^^

1

I am running both IDEA and PhpStorm on a laptop. When I work in an office environment with monitors, I have to logout first. Restarting the program doesn't help - everything will be scaled like in the previous environment until I logout. 

This is honestly really annoying and I don't have this issue with any other program. I understand it's JRE-managed, but still this should not really be acceptable and I hope  you are working on a solution for this. I often have programs running in my windows session which I all need to re-open after logout, it's a bit like losing the ability to hibernate the laptop.

2
Hi everyone.

The issue with the IntelliJ IDEA UI mis-scaling  was caused by incorrectly switching the DPI-awareness mode in runtime. Unfortunately, we were unable to fix it in the IDEA 2017.2 updates due to limitations of the native platform (WinAPI). The need to switch the “per-monitor-DPI-aware” mode was caused by the fact that IDEA 2017.2 didn’t support fractional scale monitors in that mode.
 
The fractional monitor scale support in the “per-monitor-DPI-aware” mode is targeted for the IDEA 2018.1 release coming next spring. This will eliminate the necessity to switch the DPI-awareness in runtime and fix all problems it caused. This means the DPI-awareness will be defined by the “sun.java2d.uiScale.enabled” VM option and will not be changed in runtime.

In IDEA 2017.3, which doesn’t yet support fractional monitor scale, the DPI-awareness switch mechanism will be removed as well. Instead, in the "per-monitor-DPI-aware" mode the monitor scale will be rounded to the nearest integer. For example, 225% scale - to 200%, 250% scale - to 300%. We will switch the default DPI-awareness back to "system-DPI-aware". This should not affect the majority, however this can be noticeable for the users working in a multi-monitor environment, all in different integral scales (e.g. 100% + 200%). These users will experience blurriness on secondary monitors, like it was in the IntelliJ IDEA 2017.1 and below. To avoid that, they will have to manually set the “-Dsun.java2d.uiScale.enabled=true" VM option to enable the "per-monitor-DPI-aware" mode.

Sorry for the inconvenience.
3

Hi:

I am using PHPStorm on a Lenovo T460 under Windows 10 with a mouse. I work  in several locations all of which have an appropriate dock connecting to a Dell display. On connecting to the dock the display transfers from the laptop to Display #2.  I have experienced all of the scaling problems of the display, but in addition, the mouse is almost useless in that the scaling to position the pointer is always off by many pixels.

Have you any suggestions as to  fixing the mouse scaling? It would be of serious help if you could do that.

 

0

Hi,

I tried all the mentioned options, but without success.
Anybody have a new approach?

Regards,
- Paulo Henrique

0

Please sign in to leave a comment.

Have more questions?

Submit a request