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

8248126: JavaFX ignores HiDPI scaling settings on some linux platforms #396

Closed
wants to merge 1 commit into from

Conversation

pankaj-bansal
Copy link
Collaborator

@pankaj-bansal pankaj-bansal commented Feb 7, 2021

JavaFX ignores the HiDPI scaling settings on Fedora 32 and Ubuntu 20.04.

The scale detection in JavaFX assumes that the "scaling-factor" setting in "org.gnome.desktop.interface" has the correct Hi-DPI setting. But this not true for some systems and "scaling-factor" has value of 0. JavaFX should detect the windows level scale factor automatically in this case, but this logic is missing right now. So, the JavaFX applications are not scaled properly.
This issue can be reproduced by setting the scale from Settings->Displays->Set Scale. Note, the option for scale may not be present from some resolution settings, so you may need to change it to see the option to scale the full windowing system. The issue can be verified by running some JavaFX applications/samples. The application will not be scaled properly according to the UIScale. https://bugs.openjdk.java.net/browse/JDK-8258464 is similar bug and has been closed as duplicate.

This fix adds the logic to detect the scale from windows system itself.
I have ran all automated unit tests and system tests, this fix is not causing any new failures. I have tested this on fedora 32 VM, Ubuntu 20.04 VM and Ubuntu 20.10 VM.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8248126: JavaFX ignores HiDPI scaling settings on some linux platforms

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jfx pull/396/head:pull/396
$ git checkout pull/396

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 7, 2021

👋 Welcome back pbansal! 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.

@pankaj-bansal pankaj-bansal changed the title 8248126: JavaFX ignores HiDPI scaling settings on Fedora 32 (Gnome) 8248126: JavaFX ignores HiDPI scaling settings on some linux platforms Feb 9, 2021
@pankaj-bansal pankaj-bansal marked this pull request as ready for review February 9, 2021 15:01
@openjdk openjdk bot added the rfr Ready for review label Feb 9, 2021
@mlbridge
Copy link

mlbridge bot commented Feb 9, 2021

Webrevs

@kevinrushforth
Copy link
Member

This is a simple enough fix, but it would be helpful to have a second reviewer take a look, and test it.

/reviewers 2

@openjdk
Copy link

openjdk bot commented Feb 9, 2021

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I tested on Ubuntu 20.04 with both GTK3 and GTK2.

Copy link
Member

@arapte arapte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, verified with Ubuntu 20.04.

@openjdk
Copy link

openjdk bot commented Feb 15, 2021

@pankaj-bansal This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8248126: JavaFX ignores HiDPI scaling settings on some linux platforms

Reviewed-by: kcr, arapte

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 4 new commits pushed to the master branch:

  • a23d4ae: 8252099: JavaFX does not render Myanmar script correctly
  • 9c8d30a: 8249737: java.lang.RuntimeException: Too many touch points reported
  • e85ce5a: 8258986: getColor throws IOOBE when PixelReader reads the same pixel twice
  • 676cf3e: 8259046: ViewPainter.ROOT_PATHS holds reference to Scene causing memory leak

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Feb 15, 2021
@pankaj-bansal
Copy link
Collaborator Author

/integrate

@openjdk openjdk bot closed this Feb 15, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Ready to be integrated rfr Ready for review labels Feb 15, 2021
@openjdk
Copy link

openjdk bot commented Feb 15, 2021

@pankaj-bansal Since your change was applied there have been 4 commits pushed to the master branch:

  • a23d4ae: 8252099: JavaFX does not render Myanmar script correctly
  • 9c8d30a: 8249737: java.lang.RuntimeException: Too many touch points reported
  • e85ce5a: 8258986: getColor throws IOOBE when PixelReader reads the same pixel twice
  • 676cf3e: 8259046: ViewPainter.ROOT_PATHS holds reference to Scene causing memory leak

Your commit was automatically rebased without conflicts.

Pushed as commit 782f22a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@pankaj-bansal pankaj-bansal deleted the JDK-8248126 branch February 15, 2021 08:18
@rnayabed
Copy link

rnayabed commented Feb 15, 2021

This is amazing. I had to set uiScale on startup because it wouldnt work on ubuntu 20.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
4 participants