Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper GUI scaling on HiDPI displays. #137

Open
johann-petrak opened this issue Jan 22, 2021 · 7 comments
Open

Proper GUI scaling on HiDPI displays. #137

johann-petrak opened this issue Jan 22, 2021 · 7 comments

Comments

@johann-petrak
Copy link
Contributor

johann-petrak commented Jan 22, 2021

Tested on a laptop with Ubuntu 20.04.1, 2880x1620 resolution set to 200% scaling in the default window manager. Tested with both the "fractional scaling" option enabled and disabled.

Tested to run a freshly installed revision 9532ab9 and also
on a freshly compiles (with Java 8) revision 81d16d5

Tested with Java versions:

  • Java.net 11.0.8-open
  • Java.net 8.0.265-open
  • AdoptOpenJDK 15.0.1.j9-adpt

All three showed the splash screen and GUI without scaling.

Workarounds that worked for me in these cases:

  • running with the parameter added: -Dsun.java2d.uiScale=2.0
  • setting the environment variable GDK_SCALE=2.0 before running

Same with the Mate window manager

@johann-petrak
Copy link
Contributor Author

Note to self: the following settings are mentioned on the internets for adjusting scaling or dealing with HiDPI problems:

  • -Dsun.java2d.uiScale.enabled=false/true
  • -Dsun.java2d.win.uiScaleX=2.0
  • -Dsun.java2d.uiScale=1.0
  • -Dsun.java2d.uiScale.enabled=false/true

@dianamaynard
Copy link

MacBook Pro (16-inch, 2019)
1280x720 resolution

GATE 9.0-SNAPSHOT build 81d16d5 started at Sat Jan 23 17:17:33 GMT 2021
and using Java 1.8.0_181 Oracle Corporation on Mac OS X x86_64 10.15.7.

Everything looks normal

@greenwoodma
Copy link
Contributor

Dell XPS-13 with Ubuntu 16.04

3200x1800 display with the scale for menu and titlebars set to 2

Under Java 8 this results in a tiny little version of GATE that's half the size it should be.
Under Java 9 and above (at least up to and including 13) it works as expected with properly scaled fonts etc.

@johann-petrak
Copy link
Contributor Author

@greenwoodma do the workarounds also work for you when the GATE is tiny under Java 8?

  • running with the parameter added: -Dsun.java2d.uiScale=2.0
  • setting the environment variable GDK_SCALE=2.0 before running

@greenwoodma
Copy link
Contributor

No. If I use either on their own and Java 8 then it's still tiny, even using both at the same time makes no difference.

@johann-petrak
Copy link
Contributor Author

OK so it seems behaviour depends on both the Java and Ubuntu versions.

@greenwoodma
Copy link
Contributor

Yes, it looks like you have different display options (i.e. fractional scaling) which I don't in 16.04 so my guess is this affects the numbers that Java retrieves from the OS and hence how it then scales things; one of the numbers used deep in the scaling comes from the AWT Toolkit under the property name "gnome.Xft/DPI"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants