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

Sample app scaling doesn't match OS scaling settings #16

Open
zugaldia opened this issue Jan 4, 2019 · 2 comments
Open

Sample app scaling doesn't match OS scaling settings #16

zugaldia opened this issue Jan 4, 2019 · 2 comments

Comments

@zugaldia
Copy link

zugaldia commented Jan 4, 2019

This might go beyond the goal of these samples but, while I'm able to run them, I'm noticing that the scaling of the javaFX app doesn't match the OS:

image
Notice how the text in the Label' is smaller than the window title or the code in the background (IntelliJ)

This is running on Ubuntu 18.04 with 200% scale (Settings -> Devices -> Displays), JDK 11 downloaded from here and jmods downloaded from here. I wonder if this is an issue with my set up, or there's a missing flag/setting in the sample code that needs to be added.

@jperedadnr
Copy link
Collaborator

Have you tried same sample with JDK 9 or 10? See http://openjdk.java.net/jeps/263
Also have you tried running the sample with GTK2 or GTK3?

@zugaldia
Copy link
Author

zugaldia commented Jan 7, 2019

Thank you @jperedadnr for the quick and informative reply.

Also have you tried running the sample with GTK2 or GTK3?

I added applicationDefaultJvmArgs = ["-Djdk.gtk.verbose=true", "-Djdk.gtk.version=3"] to the build.gradle file to force GTK3 usage and enable some additional debugging. This is the output I'm seeing:

checking GTK version 3
trying GTK library libgtk-3.so.0
using GTK library version 3 set libgtk-3.so.0
Glass GTK library to load is glassgtk3
loaded gdk_x11_display_set_window_scale
loaded g_settings_schema_source_get_default
loaded g_settings_schema_source_lookup
loaded g_settings_schema_has_key
found schema 'org.gnome.desktop.interface' and key 'scaling-factor'
loaded g_settings_schema_unref

Unfortunately, that doesn't seem to have any effect on how the JavaFX app is rendered (content still looks about half the size it should).

Same thing if I try GTK2:

checking GTK version 2
trying GTK library libgtk-x11-2.0.so.0
using GTK library version 2 set libgtk-x11-2.0.so.0
Glass GTK library to load is glassgtk2
Gtk-Message: 12:09:24.343: Failed to load module "canberra-gtk-module"
loaded g_settings_schema_source_get_default
loaded g_settings_schema_source_lookup
loaded g_settings_schema_has_key
found schema 'org.gnome.desktop.interface' and key 'scaling-factor'
loaded g_settings_schema_unref

I've only tried this with JDK11 but from http://openjdk.java.net/jeps/263 it seems this should be working since JDK9?

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

No branches or pull requests

2 participants