RFR: 8269639: [macos] Calling stage.setY(0) twice causes wrong popups location

Jose Pereda jpereda at openjdk.java.net
Sat Jul 17 00:21:08 UTC 2021


As described in the issue, when the stage is moved to the screen top position, it is moved below the system menu bar. However, doing it twice doesn't trigger a native callback to the Java layer, and the stage yPosition doesn't get updated with the actual position of the application. This has several side effects, like the wrong popup control position.

This PR adds a callback in case set position doesn’t match actual position. 

It is only going to be called when the final position of the stage doesn't match the one that was set, which could happen in rare occasions, mainly due to constrains applied by the native layer, so it doesn't add any overhead.

A system test for MacOS is included.

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

Commit messages:
 - Add a callback in case set position doesn’t match actual position. Include test

Changes: https://git.openjdk.java.net/jfx/pull/580/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=580&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8269639
  Stats: 136 lines in 2 files changed: 136 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jfx/pull/580.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/580/head:pull/580

PR: https://git.openjdk.java.net/jfx/pull/580


More information about the openjfx-dev mailing list