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
12 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
9

@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.
5

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.

 

1

Hi,

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

Regards,
- Paulo Henrique

1

On windows 10 - >Dibyo Majumdar ->FIX worked also for me.

0

IDEA 2017.3 insists on applying this ridiculous raster stretching scaling mode that looks blurry and distorted for me on my 4K monitor in Windows 10.

With IDEA 2017.2 there was a workaround possible by setting the compatibility mode to "Application managed" which disabled the scaling and bumping up the font sizes in settings. Now this does nothing.

I have found that setting this flag

-Dsun.java2d.uiScale.enabled=true

fixes the blurriness, however it's still worse (spacing between UI elements seems off) than disabling the scaling altogether as was possible in 2017.2.

Edited by Ivan Poliakov
0

Still no solution including the comment above. Let me reiterate the problem that is afflicting me. I am running PhpStorm 2017.3 on a Windows 10 machine but the problem was evident in 2017.2. The laptop is connected through a Lenovo dock and an HDMI cable to a Dell monitor.

When starting  from a system startup the scaling is correct. However, at some random point the scaling changes and the the cursor positioning becomes confused but reproducible.  If the cursor is moved to line "n" by the mouse and clicked then the new cursor position is at line "n-2"  rather than at "n" always. Focus in the machine is not a problem.

Closing the system down to a reboot always fixes the problem but ruins all productivity measures.

Any help would really be apprciated.

1

In my case, I have totally different problem with scaling. All of the context menus as well as the tooltips with for example code hints are either badly located or are shrunk to unusable size.

From my observations, the location where context menus got popped up is not constant.

And of course, scaling of fonts doesn't work.

I'm running Pycharm on Windows10 x64. I'm using it on Dell laptop which has connected 4k monitor through the dell's docking station.

 

0

As said by Anton Tarasov https://intellij-support.jetbrains.com/hc/en-us/articles/115001260010/comments/115000155590 . 

The flag  : -Dsun.java2d.uiScale.enabled=true  is what fixed it for me. Flag to TRUE. Because the first post by Serge Baranov mentionned to set it to false!

 

0

oh noooooo....just updated to 2017.3.2 and DPI were broken again even with previously worked trick :(((

 

Now i need to switch off simple trick in the compatibility mode and add mentioned switch to jvm start command line =\

0

Please sign in to leave a comment.

Have more questions?

Submit a request