RFR: 8353548: [macOS] DragEvent.getScreenY() returns incorrect value in secondary monitor

Jose Pereda jpereda at openjdk.org
Wed Apr 2 17:10:06 UTC 2025


This PR fixes an issue when dragEvents occur in a secondary screen which doesn't have the same height or (macOS) origin as the main screen.

The calculations for `xAbs, yAbs` are defined from the main screen macOS absolute origin, an in order to flip the coordinates defined from the JavaFX origin, the height from the main screen should be used, and not the height from secondary screens, which was the case in `GlassViewDelegate::sendJavaDndEvent`.

The PR doesn't include tests because it needs a complex setup (two monitors), but the change has been tested on macOS 15.3.2 with the test case from https://bugs.openjdk.org/browse/JDK-8353548, using two monitors (built-in Retina and external 4K display), rearranging their layout (left-bottom-right from main screen), and relative resolution.

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

Commit messages:
 - Use correct screen to calculate yAbs in a dragEvent

Changes: https://git.openjdk.org/jfx/pull/1756/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1756&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8353548
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jfx/pull/1756.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1756/head:pull/1756

PR: https://git.openjdk.org/jfx/pull/1756


More information about the openjfx-dev mailing list