RFR: 8371302: [Windows] Stage coordinates in secondary display are not properly updated after changing settings of first display
Andy Goryachev
angorya at openjdk.org
Thu Nov 6 18:37:21 UTC 2025
On Wed, 5 Nov 2025 11:44:40 GMT, Jose Pereda <jpereda at openjdk.org> wrote:
> 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.
For testing, I've added the scale/size/position info to the main window status bar in the monkey tester:
https://github.com/andy-goryachev-oracle/MonkeyTest
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1963#issuecomment-3498830263
More information about the openjfx-dev
mailing list