Skip to content

Conversation

@jperedadnr
Copy link
Collaborator

@jperedadnr jperedadnr commented Nov 5, 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 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.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8371302: [Windows] Stage coordinates in secondary display are not properly updated after changing settings of first display (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1963/head:pull/1963
$ git checkout pull/1963

Update a local copy of the PR:
$ git checkout pull/1963
$ git pull https://git.openjdk.org/jfx.git pull/1963/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1963

View PR using the GUI difftool:
$ git pr show -t 1963

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1963.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 5, 2025

👋 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.

@openjdk
Copy link

openjdk bot commented Nov 5, 2025

@jperedadnr This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

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

Reviewed-by: angorya, kcr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 5 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Ready for review label Nov 5, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 5, 2025

Webrevs

@kevinrushforth
Copy link
Member

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

/reviewers 2

@kevinrushforth kevinrushforth self-requested a review November 5, 2025 14:13
@openjdk
Copy link

openjdk bot commented Nov 5, 2025

@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).

@andy-goryachev-oracle
Copy link
Contributor

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

Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on windows, using the latest master + this PR + #1964

The windows, their child windows, their popup menus all work as expected when changing scale and adjusting relative position of the monitors.

Excellent work chasing all these issues!

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good. My initial testing looks good. I'll do some final testing tomorrow.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All testing looks good. This is a safe and simple change.

@openjdk openjdk bot added the ready Ready to be integrated label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Ready to be integrated rfr Ready for review

Development

Successfully merging this pull request may close these issues.

3 participants