RFR: 8371302: [Windows] Stage coordinates in secondary display are not properly updated after changing settings of first display
Jose Pereda
jpereda at openjdk.org
Wed Nov 5 11:50:44 UTC 2025
This PR handles two windows events, `WM_DISPLAYCHANGE` and `WM_SETTINGCHANGE`, that can be received by a JavaFX Window on a given display when other display changed its settings (resolution), or both displays were rearranged, and therefore its location has changed.
When this happens, `com.sun.glass.ui.Window` has the new updated location, but the `javafx.stage.Window` does not, and triggering a `Window.MOVE` event notifies the stage to update its location accordingly.
There are no tests added to this PR (those would require two monitors, and external changes of Windows Settings), but the [test](https://bugs.openjdk.org/secure/attachment/116917/RenderScaleTest.java) attached to the JBS issue passes after this PR running some manual tests: for the stage at secondary display, check that the location is updated properly and the context menu shows up at the expected position, when the primary display resolution changes via Settings->System->Display->Scale, or when both displays are rearranged via Settings->System->Display->Drag to rearrange.
-------------
Commit messages:
- Notify stage to update its location after display or settings changed
Changes: https://git.openjdk.org/jfx/pull/1963/files
Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1963&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8371302
Stats: 7 lines in 1 file changed: 7 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jfx/pull/1963.diff
Fetch: git fetch https://git.openjdk.org/jfx.git pull/1963/head:pull/1963
PR: https://git.openjdk.org/jfx/pull/1963
More information about the openjfx-dev
mailing list