Jabref: [Enhancement] HiDPI scaling on Linux with Gnome 3

Created on 22 Oct 2019  Â·  10Comments  Â·  Source: JabRef/jabref

JabRef looks very different depending on resolution.
In QHD the elements are more or less reasonable (although the toolbar is hidden when the window is snapped #5499), the UHD version is just not usable because the buttons are smaller that the scaled mouse pointer.

2560×1440 QHD, 100% scale in Gnome 3:
jabref_2k
3840×2160 UHD, 200% scale in Gnome 3:
jabref_4k

JabRef 5.0.0-dev--2019-10-21----f86944aae
Linux 5.3.7-zen1-1-zen amd64 
Java 12.0.2
$ gnome-shell --version
GNOME Shell 3.34.1
enhancement ui

Most helpful comment

To clarify: the scaling doesn't work properly even if _only one_ screen is used. With 2-monitor setup it might be even worse.

Well, Gnome apps, Firefox, IntelliJ-based IDEs (written in Java) have no obvious troubles when they switch between HD and UHD.

I'm not really familiar with Java but the docs mention that OpenJFX can get the current screens DPI

All 10 comments

It is better scaled in Windows with 3840×2160:
Capture

A GIF that compares relative size of the interface:
Linux 2.5K — Linux 4K — Windows 4K
out

You can change the (font) size in the preferences. This should then scale everything accordingly.

Well, changing this value every time I connect to a screen is definitely not the thing I want to do.
Can't the factor be taken from the shell and applied automatically?

I don't see a way to automate this. Suppose the user has two monitor's with different resolution. How should JabRef know on which monitor it is displayed and which base value to choose for the font? Moreover, there are so many things that influence the effective size on the screen besides the resolution (dpi scaling e.g).

To clarify: the scaling doesn't work properly even if _only one_ screen is used. With 2-monitor setup it might be even worse.

Well, Gnome apps, Firefox, IntelliJ-based IDEs (written in Java) have no obvious troubles when they switch between HD and UHD.

I'm not really familiar with Java but the docs mention that OpenJFX can get the current screens DPI

You can adjust the hdpi scale using a command line switch:
https://github.com/JabRef/jabref/issues/6086#issuecomment-596536235

On my Ubuntu 20.10 machine passing of command line arguments did not work when I installed JabRef via snap. But when I used the .deb file from the Releases section of this GitHub page, I was able to get an acceptable size using

_JAVA_OPTIONS='-Dglass.gtk.uiScale=2.0' /opt/jabref/bin/JabRef

(the variable content is documented here)

The underlying problem seems to be again a javafx/linux bug https://bugs.openjdk.java.net/browse/JDK-8258464

You can adjust the hdpi scale using a command line switch:
#6086 (comment)

I don't know why modifying /opt/jabref/lib/app/JabRef.cfg no longer works after having updated to 5.2. The environment variable _JAVA_OPTIONS works, however.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tobiasdiez picture tobiasdiez  Â·  4Comments

a-torgovitsky picture a-torgovitsky  Â·  3Comments

humbleambition picture humbleambition  Â·  3Comments

LinusDietz picture LinusDietz  Â·  3Comments

AEgit picture AEgit  Â·  4Comments