RFR: JDK-8282232: [Win] GetMousePositionWithPopup test fails due to wrong mouse position [v2]

Harshitha Onkar honkar at openjdk.org
Fri Apr 7 17:57:41 UTC 2023


> This test issue was due to race condition that occured when using `-Dsun.java2d.uiScale >= 2`.
> As a result it led to incorrect mouse position being compared as opposed to the updated mouse position after the final mouse move event.
> 
> Following is the event log before and after fix.
> 
> **Before fix:**
> 
> 1st mouse move
> 2nd mouse move
> Frame-1 Mouse Event
> Frame-2 Mouse Event
> java.awt.Point[x=29,y=29]
> 
> 
> **After fix:**
> 
> 1st mouse move
> 2nd mouse move
> Frame-1 Mouse Event
> 3rd mouse move
> Frame-2 Mouse Event
> java.awt.Point[x=50,y=50]
> 
> 
> Earlier Frame-2's mouseMoved() was being triggered on Robot's 2nd mouse move instead of 3rd mouse move. To fix it, the mouseMotionListener for Frame-2 is now added after Robot's 2nd mouse move is processed to avoid the race condition.
> 
> The updated test fix is checked on multiple uiScales including fractional scales for windows platform.
> CI testing works as expected on all platforms.

Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:

  added syncLocationToWindowManager(), changed literals to vars

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/13380/files
  - new: https://git.openjdk.org/jdk/pull/13380/files/663cc178..fc5f4808

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13380&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13380&range=00-01

  Stats: 37 lines in 1 file changed: 19 ins; 5 del; 13 mod
  Patch: https://git.openjdk.org/jdk/pull/13380.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13380/head:pull/13380

PR: https://git.openjdk.org/jdk/pull/13380



More information about the client-libs-dev mailing list