HiDpi Scaling works with tool box but not intellij



I'm usign KDE on Archlinux, I'm having some scaling issues with IntelliJ. As you can see on the screenshot,  the scaling of the toolbox application is working fine but not  IntelliJ

I could set up to override fonts to the size i want (which works) but it messes up with my other computers as my settings are synced between all my machines.

I tried using environment variable GDK_SCALE=2 but it doesn't work either.


Is there a way to fix this via OS setup or some launch arguments ?


Thanks in advance,





Comment actions Permalink

What JDK version is used to run IntelliJ IDEA? See https://intellij-support.jetbrains.com/hc/articles/206544879.

Paste the info from About screen.

See idea.log (https://intellij-support.jetbrains.com/hc/articles/207241085) for the scaling factor detected by the IDE.

Comment actions Permalink

From the logs:

2018-06-03 09:37:43,800 [      0]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------
2018-06-03 09:37:43,942 [    142]   INFO -        #com.intellij.idea.Main - IDE: IntelliJ IDEA (build #IU-181.5087.20, 17 May 2018 05:43)
2018-06-03 09:37:43,943 [    143]   INFO -        #com.intellij.idea.Main - OS: Linux (4.16.13-1-arch, amd64)
2018-06-03 09:37:43,943 [    143]   INFO -        #com.intellij.idea.Main - JRE: 1.8.0_152-release-1136-b39 (JetBrains s.r.o)
2018-06-03 09:37:43,943 [    143]   INFO -        #com.intellij.idea.Main - JVM: 25.152-b39 (OpenJDK 64-Bit Server VM)
2018-06-03 09:37:43,947 [    147]   INFO -        #com.intellij.idea.Main - JVM Args: -Xms128m -Xmx750m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine -Dide.no.platform.update=true -XX:ErrorFile=/home/gz/java_error_in_IDEA_%p.log -XX:HeapDumpPath=/home/gz/java_error_in_IDEA.hprof -Didea.paths.selector=IntelliJIdea2018.1 -Djb.vmOptionsFile=/home/gz/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/181.5087.20.vmoptions -Didea.jre.check=true
2018-06-03 09:37:43,947 [    147]   INFO -        #com.intellij.idea.Main - ext: /home/gz/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/181.5087.20/jre64/lib/ext: [localedata.jar, meta-index, jfxrt.jar, cldrdata.jar, zipfs.jar, dnsns.jar, sunjce_provider.jar, sunpkcs11.jar, sunec.jar, nashorn.jar, jaccess.jar]
2018-06-03 09:37:43,947 [    147]   INFO -        #com.intellij.idea.Main - JNU charset: ANSI_X3.4-1968
2018-06-03 09:37:43,965 [    165]   INFO -        #com.intellij.idea.Main - JNA library (64-bit) loaded in 17 ms
2018-06-03 09:37:44,008 [    208]   INFO -     #com.intellij.util.ui.JBUI - User scale factor: 1.0
2018-06-03 09:37:44,008 [    208]   INFO -     #com.intellij.util.ui.JBUI - System scale factor: 1.0 (IDE-managed HiDPI)
2018-06-03 09:37:44,773 [    973]   INFO - .intellij.idea.IdeaApplication - CPU cores: 4; ForkJoinPool.commonPool: java.util.concurrent.ForkJoinPool@7f99e2b7[Running, parallelism = 3, size = 0, active = 0, running = 0, steals = 0, tasks = 0, submissions = 0]; factory: com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory@3736cce4
2018-06-03 09:37:44,820 [   1020]   INFO - .intellij.idea.IdeaApplication - WM detected: KWin




Here's the About screen:

Comment actions Permalink

Please see https://youtrack.jetbrains.com/issue/IDEA-192797.

You can either increase the default font size (Settings > Appearance & Behavior > Appearance > Override default font) so that UI scaling factor is calculated from it or add -Dide.ui.scale=2.0 in Help | Edit Custom VM Options.

Comment actions Permalink

That's working fine !


Thanks !

Comment actions Permalink

It's nice that there is a work-a-round that works for some people, but in my case this requires me to change that setting dozens of times each day.

I have a laptop with a built-in 4K display (200% scaling), and an external 4K display (100% scaling).  When I unplug my external display everything resizes to fit on my scaled laptop screen.  Which is great!  Every other piece of software I am running resizes and looks perfect on the scaled laptop screen.  All JetBrains products turn into micro-print on the laptop screen and become unreadable until I plug in an external display or change the setting suggested above.  Gnome remembers my scaling and window positioning so well that I forget there is any scaling involved, it is completely seamless except for what happens to IntelliJ, CLion, DataGrip, and PyCharm when switching between screens.

I realize that my use case may not be the most common, but I wish JetBrains products worked like other apps do in gnome.  Thanks for listening.

Comment actions Permalink

https://youtrack.jetbrains.com/issue/IDEA-194145 could be related.

Does it help if you add -Dsun.java2d.uiScale.enabled=true in Help | Edit Custom VM Options and restart IntelliJ IDEA?

Comment actions Permalink

I also have this problem with a 4k monitor and 2 1080p monitors. IntelliJ looks blurry on the 4K monitor on Ubuntu Wayland with 200% desktop scaling.

Comment actions Permalink

Please specify the Java version you are using to run IntelliJ IDEA. Does it happen with JBR11 as well? https://intellij-support.jetbrains.com/hc/articles/206544879.

Comment actions Permalink

I had the same issue with PyCharm after updating to 2019.2. I fixed the issue by switching boot JDK to the one from PyCharm 2018.2

Comment actions Permalink

Hi Serge, thanks for fast response. I checked your article and the only thing which works for me is:

IDE-managed HiDPI mode (legacy mode).

Enabled via the VM option:  -Dsun.java2d.uiScale.enabled=false


I have PyCharm community installed with snap on Ubuntu.

Comment actions Permalink

Setting -Dsun.java2d.uiScale.enabled=false

Also fixed the large scaling issue for me.

Pycharm 2019.2, Ubuntu 16.04, JDK 11.0.3+12



Please sign in to leave a comment.