editor2-issues icon indicating copy to clipboard operation
editor2-issues copied to clipboard

HiDPI scaling support for Linux

Open tomires opened this issue 7 years ago • 6 comments

Are there any plans to include support for scaling in editor2? I have tried modifying both scale-factor and text-scale-factor keys in dconf to no avail [as seen on the following screenshot].

screenshot from 2017-03-07 18 38 24

tomires avatar Mar 07 '17 17:03 tomires

HiDPI support for Linux is unfortunately missing in JavaFX, however it is coming in JDK9: https://bugs.openjdk.java.net/browse/JDK-8137050

ragnard-king avatar Mar 08 '17 09:03 ragnard-king

I've tried the latest editor2 release and I'm noticing that it's still not scaled on OpenJDK 9. Are there other steps involved in enabling HiDPI support on Linux?

ghost avatar Jan 31 '18 15:01 ghost

It's because defold provides it's own jdk (which is 8). There is hope they will migrate to jdk 11 though, since it's a new LTS release.

vlaaad avatar Sep 27 '18 12:09 vlaaad

Everything is still so tiny! +1 for some form of scaling.

thejustinwalsh avatar May 21 '20 17:05 thejustinwalsh

By the way, Defold editor migrated to jdk 11 in 2019 and HiDPI works on my Ubuntu

vlaaad avatar May 21 '20 19:05 vlaaad

For whatever reason if I set global fractional scaling in gnome 3.36 on Ubuntu 20.04 the Defold editor actually gets smaller the higher the scale goes. :man_shrugging:

So here is the fix. You need to pass -Dglass.gtk.uiScale=1.25 where 1.25 equals the amount you want to scale by. 1.25 is a nice compromise on a 4K monitor at 100% in gnome.

To do this edit the config file sitting next to Defold and find the vmargs under the [launcher] section. I simply prepended -Dglass.gtk.uiScale=1.25, before the -Dfile.encoding=UTF-8 arg.

vmargs = -Dglass.gtk.uiScale=1.25,-Dfile.encoding=UTF-8,-Djna.nosys=true,-Ddefold.launcherpath=${bootstrap.launcherpath},-Ddefold.resourcespath=${bootstrap.resourcespath},-Ddefold.version=${build.version},-Ddefold.editor.sha1=${build.editor_sha1},-Ddefold.engine.sha1=${build.engine_sha1},-Ddefold.buildtime=${build.time},-Ddefold.channel=${build.channel},-Djava.net.preferIPv4Stack=true,-Dsun.net.client.defaultConnectTimeout=30000,-Dsun.net.client.defaultReadTimeout=30000,-Djogl.texture.notexrect=true,-Dglass.accessible.force=false,--illegal-access=warn,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.desktop/sun.awt=ALL-UNNAMED,--add-opens=java.desktop/sun.java2d.opengl=ALL-UNNAMED,--add-opens=java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED

As discovered by this change here: https://hg.openjdk.java.net/openjfx/9-dev/rt/rev/919f60d167c9#l1.51

Unfortunately upon every upgrade the config gets wiped and I loose my scaling setting. Exposing some kind of UI scale configuration in the editor itself would still be cool.

thejustinwalsh avatar May 22 '20 18:05 thejustinwalsh