Support high-density screens
On 4K displays (e.g. 15" 3840*2160) the app window is too small. It needs to support default platform scaling.
I've tested on Linux (Ubuntu 16.04.1) only, because I don't have Win/Mac device with 4K display yet.
Comments (7)
-
reporter -
reporter Another workaround (on Windows) is to use JDK bundled with Android Studio (aka JetBrains Runtime). One needs to point JAVA_HOME to the Studio's JDK and set
LOGVIEW_OPTS=-Dsun.java2d.uiScale.enabled=true
in environment. -
reporter - changed milestone to 0.21
-
reporter It looks like the Linux situation is more broken than I thought. I've failed to set up 1.5 scaling on Ubuntu 16.04 with JDK 11. The same configuration seems to works on my desktop though (I need to re-check). Setting 2x scaling with
GDK_SCALE=2
or-Dsun.java2d.uiScale.enabled=true
works though. -
reporter Fractional scaling on linux seems to be affected by https://bugs.openjdk.java.net/browse/JDK-8214227 (i.e. not supported)
-
reporter Fractional scaling is not supported by Jetbrains Runtime as well: https://youtrack.jetbrains.com/issue/JBR-1365
Not so many options left: 1. Manual scaling everywhere (moderately difficult) 2. Check if JavaFX supports fractional scaling and rewrite UI in JavaFX (checking is easy, rewriting is hard however beneficial to code health and my knowledge of JavaFX :)) 3. Check if SWT supports fractional scaling and rewrite UI in SWT (again, checking is easy, rewriting is hard and I'm not sure SWT is a feasible choice).
-
reporter JPackage is going to hit stable in Java 16. I should probably bundle the runtime with the app so users with HiDPI displays don't have to set up a separate JDK.
- Log in to comment
The workaround that I use now is to run the app with JDK 11. Support for HiDPI in Swing was added in JDK 10, now it respects system-wide scaling. However, Android developers often stuck on JDK 8 so some solution is needed here: