On Tue, 7 Jan 2025 21:29:17 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> 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. >> >> 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. >> >> There are no tests added to this PR, since these would require manual >> intervention to change the display. In any case, the test case added to the >> [issue](https://bugs.openjdk.org/browse/JDK-8346281) runs fine now when the >> app runs on a given screen and the user changes its resolution. >> >> There is a follow-up issue after this PR, that might require a more complex >> fix, for the case where the user changes the resolution of a different >> screen that is placed before the one that has the application (as location >> coordinates of the latter depend on the former), because there is no >> `WM_DPICHANGED` event in this case. > > As a quick note, when the multi-monitor support was added for HiDPI, the code > to check `WM_DPICHANGED` was intentionally removed. See [this comment in > JDK-8146920](https://bugs.openjdk.org/browse/JDK-8146920?focusedId=14034147&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14034147). > I'll look closer when I review it. Thanks for the link @kevinrushforth , it helps a lot clarifying a few things. I didn't find issues with `WM_DPICHANGED` (yet), but I didn't test those edge cases that are mentioned. I see several different issues related to DPI changes (with and without my patch), and I can reproduce the issue that @andy-goryachev-oracle mentioned, so definitely this PR needs more work, and probably some follow-ups. ------------- PR Comment: https://git.openjdk.org/jfx/pull/1668#issuecomment-2576337387