On Fri, 18 Sep 2026 10:44:56 GMT, Jayathirth D V <[email protected]> wrote:

>> GetScreenLocTest is mainly checking whether getLocationOnScreen() picks 
>> proper information.
>> 
>> With latest JDK code this test fails locally on macOS and windows, mostly 
>> because mouse event is not getting recognised because of decorated window. 
>> On local Oracle Linux VM, i can see that sometimes the smaller frame is not 
>> even shown and test fails. We need to make the windows undecorated and make 
>> sure things are rendered before we start selecting things on the frame.
>> 
>> After making test more robust, it runs fine on all platforms.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Jayathirth D V has updated the pull request with a new target base due to a 
> merge or a rebase. The pull request now contains eight commits:
> 
>  - Update test
>  - Fix PL
>  - Merge remote-tracking branch 'upstream/master' into 4753654
>  - Merge remote-tracking branch 'upstream/master' into 4753654
>  - Fix conflict in PL
>  - Use EDT for canvas
>  - Initial change
>  - Remove from PL

test/jdk/java/awt/Component/GetScreenLocTest/GetScreenLocTest.java line 75:

> 73: 
> 74:         EventQueue.invokeAndWait(() -> {
> 75:             p = canvas.getLocationOnScreen();

This is an AWT component, you do not need to use EDT to access that. I am 
pretty sure one of the reasons for the failure is updating the 
coordinates/other props on one thread, toolkit/main/EDT, and reading it without 
proper synchronization on another one.

Same question about -Dsun.java2d.uiScale=1. if the canvas receives the wrong 
coordinates at some specific dpi that is a bug in the product, or the test 
expectation is wrong. This is one of the primary goals of the test to test the 
coordinates of the component on the screen including different DPI, since we 
have specific code paths which executed only in hidpi mode.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32764#discussion_r4078133763

Reply via email to