If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2020-01-25
Here two solutions, first bash one, second using java dbus interface (linux only, windows and mac works fine). I reported this behaviour to openjdk, since it is only linux related issue, not sure if it ever be fixed, maybe it is a designed behaviour.
Hello Alexey,
that page says "Since Java 9 the GDK_SCALE environment variable is used to scale Swing applications accordingly. "
Which Java version are you using?
Does it work to set the scale factor manually as documented on that page?
I'm using Ubuntu and openjdk 11.0.5 2019-10-15, GDK_SCALE=2 works fine, but I expect java to set default.
I dig a little bit, to get current monitor scale is required to use dbus, simple python script shows how:
https://gitlab.com/Oschowa/gnome-randr/blob/master/gnome-randr.py
Here two solutions, first bash one, second using java dbus interface (linux only, windows and mac works fine). I reported this behaviour to openjdk, since it is only linux related issue, not sure if it ever be fixed, maybe it is a designed behaviour.
Using display library LinuxDisplay.getScale()
https://gitlab.com/axet/desktop/blob/dev/java/src/main/java/com/github/axet/desktop/os/linux/LinuxDisplay.java
I've check the code, something like this in stendhal Starter.java should solve HIDPI issue:
"if" line suppose to be:
Bug was accepted by Oracle: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8238077