RFR: 8371302: [Windows] Stage coordinates in secondary display are not properly updated after changing settings of first display

Kevin Rushforth kcr at openjdk.org
Wed Nov 5 14:16:27 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.

I'd like to review and test this, both in isolation and in connection with #1964

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1963#issuecomment-3491446809


More information about the openjfx-dev mailing list