On Tue, 29 Apr 2025 20:28:57 GMT, Alisen Chung <ach...@openjdk.org> wrote:

>> Here are a few cases where it still seems to fail after the update:
>> 
>> 
>> Title: secondary above the primary
>> Cmd: xrandr --output DP-0 --primary --pos 0x1440 --rotate normal --preferred 
>> --output DP-2 --pos 0x0 --rotate normal --preferred
>> 
>> screen #0 java.awt.Rectangle[x=0,y=1440,width=3440,height=1440]
>> screen #1 java.awt.Rectangle[x=0,y=0,width=2560,height=1440]
>> 
>> 
>> 
>> x  20000 y    200 [moving to]
>> - x   2559 y    200 [actual location] # before fix
>> + x   3439 y   1440 [actual location] # after fix
>> 
>> 
>> ---
>> 
>> 
>> Title: primary above the secondary, right side aligned
>> Cmd: xrandr --output DP-0 --primary --pos 0x0 --rotate normal --preferred 
>> --output DP-2 --pos 880x1440 --rotate normal --preferred
>> 
>> screen #0 java.awt.Rectangle[x=0,y=0,width=3440,height=1440]
>> screen #1 java.awt.Rectangle[x=880,y=1440,width=2560,height=1440]
>> 
>> 
>> 
>> x    200 y  20000 [moving to]
>> - x    200 y   1439 [actual location]
>> + x    880 y   2879 [actual location]
>> 
>> 
>> ---
>> 
>> 
>> Title: secondary above the primary, right side aligned
>> Cmd: xrandr --output DP-0 --primary --pos 0x1440 --rotate normal --preferred 
>> --output DP-2 --pos 880x0 --rotate normal --preferred
>> 
>> screen #0 java.awt.Rectangle[x=0,y=1440,width=3440,height=1440]
>> screen #1 java.awt.Rectangle[x=880,y=0,width=2560,height=1440]
>> 
>> 
>> 
>> x -20000 y    200 [moving to]
>> - x    880 y    200 [actual location]
>> + x      0 y   1440 [actual location]
>> 
>> x    200 y -20000 [moving to]
>> - x    200 y   1440 [actual location]
>> + x    880 y      0 [actual location]
>
> These failures when moving to the offscreen point are actually because the 
> new onscreen point being moved to is closer distance-wise than the onscreen 
> point it would have moved to before the fix.

I think it doesn't look like expected behavior anyway, the pre-clamping one 
seems more reasonable to me (as for Linux, haven't tested other platforms).

Anyway, if the we are only having issues getting the mouse pointer coordinates 
after moving it off-screen on macos, I guess the fix shouldn't change shared 
code and other platforms.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r2068877072

Reply via email to