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
169 out of 290 found this helpful
25 comments
Avatar
Permanently deleted user

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 Permanently deleted user
10
Avatar
Permanently deleted user

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

2

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
Avatar
Permanently deleted user
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
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

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 Permanently deleted user
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
Avatar
Permanently deleted user

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

The DPI scaling is not working on a 4K monitor since 2018.3.1 with Windows 10 when a scale factor of 150% is used.

Some icons are scaled not properly.

 

 

Meanwhile I need to override the DPI scaling via compatibility mode of Windows.

Edited by Gregor Kofler
0

I can confirm, that edition VM opionfixed blurry markdown preview on my 4k monitor. Everything else was fine except for the preview.

0

I am using IDEA Ultimate and PyCharm 2019.1.1 onWindows 10 and a 4K display with scaling. Everything in the IDE looks fine except the Editor.

I've tried every tip from this page but nothing fixes this issue. I have suffered from ugly font scaling with PyCharm on MacOS in the past (where this was fixed by Jetbrains). This is so annoying it makes the IDE unusable for me. Not what I expect from a professional IDE that I have advocated to buy for my whole office team. I am using Visual Studio Code for now. I don't care that it is most likely a problem base on the fact that the IntelliJ platform uses Java/Swing. If this technology doesn't cut it anymore then Jetbrains must refactor it's product.

These days you can spot a Java-based GUI application from miles away. They are the most unpleasant (und sometimes impossible) ones to look at.

2
Avatar
Permanently deleted user

I have same problem with blurry font on windows 10. I use external monitor with fullHD resolution and 125% scaling. IDE menu font looks fine, but the editor font looks bad.

I tried all posted solutions here and in other similar topics, but nothing helped.

I had no font problem with Windows 7 and this IDE.

1

Please report a bug at https://youtrack.jetbrains.com/issues/IDEA with the logs attached (https://intellij-support.jetbrains.com/hc/articles/207241085). Also provide the screenshot of the issue.

0

Are you sure it's Disable fullscreen optimizations and not Override high DPI scaling behavior?

0

What difference does it make for you? "Change high DPI settings" seems to be more relevant.

0
Avatar
Permanently deleted user

There is just no "Change high DPI settings" field.

0

Normally you don't need to specify any of these settings with the current IDE version.

If you have issues with the default settings, please report at https://youtrack.jetbrains.com/issues/IDEA and attach the screenshots / logs.

0

2020 and I still cannot read my phpstorm menu on a high dpi monitor. 

Add a frikking setting somewhere findable. 

Add a shortcut, make ctrl + work or ctrl + scroll. 

Stop wasting our time with your undefinable settings

0

2024: 7 years after first post. 

Unplugging 4k monitors → phpstorm is HUGE and unusable. 
Going to office with 1080p monitors → again phpstorm huge but less so. 
Plugging in 4k monitors → usable. 

Conclusion. Still not fixed AT all on at least 5 different laptops over 3 different subscriptions/settings. 

Every update phpstorm is getting slower and jankier to the point im looking at alternatives, what is going on at jetbrains?

 

0

Please sign in to leave a comment.

Have more questions?

Submit a request