Skip to content

Conversation

@beldenfox
Copy link
Contributor

@beldenfox beldenfox commented Dec 1, 2025

The standard way to determine the user interface scaling factor on Linux is to consult the reported monitor DPI and divide by 96 (which is also the way it's done on Windows). This allows the scaling factor to vary per-monitor and also achieve fractional values.

Before this became the standard the Gnome toolkit communicated the scaling factor using the "GDK_SCALE" environment variable or the "org.gnome.desktop.interface" "scaling-factor" gsetting. These were always integer values (no fractional scaling) and applied to all monitors. They became the de-facto way of communicating the scaling factor and were picked by various toolkits including JavaFX. They are now obsolete within Gnome.

JavaFX will compute correct per-monitor scaling factors if GDK_SCALE and "scaling-factor" aren't set. Gnome no longer sets these but unfortunately the KDE desktop does in an attempt to get certain apps to scale (one bug report specifically called out IntelliJ). In KDE for Ubuntu 24 the "scaling-factor" is always set to the floor of the actual scaling factor which is preventing JavaFX from computing fractional scales. Either setting will prevent JavaFX from computing per-monitor scales.

This PR changes the priority of the ui scale tests. As always, the JavaFX "glass.gtk.uiScale" setting takes precedence. If that's not set the system uses the scaling computed based on the monitor DPI. It only consults the legacy settings if the reported DPI is 96.

Ignoring GDK_SCALE is problematic since there are certainly users who use this as a convenient way to influence JavaFX (if only to work around this bug). If we want to provide an environment variable for them we should create our own and not rely on the legacy variables of other toolkits.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8326428: [Linux] UI scaling factor cannot be fractional when using KDE (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1994/head:pull/1994
$ git checkout pull/1994

Update a local copy of the PR:
$ git checkout pull/1994
$ git pull https://git.openjdk.org/jfx.git pull/1994/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1994

View PR using the GUI difftool:
$ git pr show -t 1994

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1994.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 1, 2025

👋 Welcome back mfox! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 1, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the rfr Ready for review label Dec 1, 2025
@mlbridge
Copy link

mlbridge bot commented Dec 1, 2025

Webrevs

@kevinrushforth
Copy link
Member

Reviewers: @lukostyra @kevinrushforth

/reviewers 2

@openjdk
Copy link

openjdk bot commented Dec 1, 2025

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

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

Labels

rfr Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants