8346281: [Windows] RenderScale doesn't update to HiDPI changes
This PR adds the missing native implementation for Windows, GlassWindow::HandleDPIEvent, to notify the (Java) window when there is a DPI change event, which can happen when the user changes the resolution of the screen (via Settings -> System -> Display -> scale), while the JavaFX application is running, in a similar way as Java Desktop handles this DPI event.
When such WM_DPICHANGED event happens, GlassWindow::HandleDPIEvent notifies the (Java) window, which changes its platform scale via Window::notifyScaleChanged, and GlassScreen::HandleDisplayChange(); is needed too, to update the platform scale of the screen where the window is at as well.
The change in Screen:: notifySettingsChanged is needed in order to prevent disposing screens that are not referenced by windows, and only do it when the screen instance of a given window does change.
There are no tests added to this PR, since these would require manual intervention to change the resolution of the display. In any case, the test case added to the issue runs fine now when the app runs on a given screen and the user changes its resolution. It has also been tested that it doesn't have any side effect on macOS.
For the case when the app runs on a different display that the one that was changed, see https://bugs.openjdk.org/browse/JDK-8371302 and a possible fix with https://github.com/openjdk/jfx/pull/1963.
Progress
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
- [ ] Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)
Issue
- JDK-8346281: [Windows] RenderScale doesn't update to HiDPI changes (Bug - P4)
Reviewers
- Andy Goryachev (@andy-goryachev-oracle - Reviewer)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1964/head:pull/1964
$ git checkout pull/1964
Update a local copy of the PR:
$ git checkout pull/1964
$ git pull https://git.openjdk.org/jfx.git pull/1964/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1964
View PR using the GUI difftool:
$ git pr show -t 1964
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1964.diff
Using Webrev
:wave: Welcome back jpereda! 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.
❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.
I'd like to review and test this, both in isolation and in connection with #1963
/reviewers 2
@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).
(Sorry, pushed now)
GHA failure in linux is intermittent https://bugs.openjdk.org/browse/JDK-8365551 , please ignore.
@jperedadnr This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!
/keepalive
@jperedadnr The pull request is being re-evaluated and the inactivity timeout has been reset.