RFR: 6899304 : java.awt.Toolkit.getScreenInsets(GraphicsConfiguration) returns incorrect values [v5]

Alexey Ivanov aivanov at openjdk.org
Mon Jan 27 14:17:01 UTC 2025


On Sun, 26 Jan 2025 00:36:11 GMT, anass baya <duke at openjdk.org> wrote:

>> Screen number 0 is not always the primary screen, so we’ve removed the code that assumes it is.
>> 
>> We used an existing test and took the following considerations into account for Windows:
>> 
>> - On Windows, undecorated maximized frames are placed over the taskbar.
>> - On Windows, the top-left corner of an undecorated maximized frame may have negative coordinates (x, y).
>> - Consider the fractional part after scaling.
>
> anass baya has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update Copyright

Changes requested by aivanov (Reviewer).

test/jdk/java/awt/Multiscreen/MultiScreenInsetsTest/MultiScreenInsetsTest.java line 31:

> 29:   and if getScreenInsets()returns the correct values across multiple monitors.
> 30:   @library /test/lib
> 31:   @build jdk.test.lib.Platform

Suggestion:

  @build jdk.test.lib.Platform jtreg.SkippedException

test/jdk/java/awt/Multiscreen/MultiScreenInsetsTest/MultiScreenInsetsTest.java line 88:

> 86:             /*
> 87:              * On Windows, the top-left corner of an undecorated maximized frame may have negative coordinates (x, y).
> 88:              * Adjust the frame bounds accordingly.

This line is too long, we usually limit the number of columns to 80.
Suggestion:

             * On Windows, the top-left corner of an undecorated maximized frame
             * may have negative coordinates (x, y).
             * Adjust the frame bounds accordingly.

Alternatively, you may wrap before _“frame”_.

test/jdk/java/awt/Multiscreen/MultiScreenInsetsTest/MultiScreenInsetsTest.java line 99:

> 97:             }
> 98: 
> 99:             // Add a margin to compensate for the lost fractional parts when casting to an integer.

Suggestion:

            // Add a margin to compensate for the lost fractional parts
            // when casting to an integer.

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

PR Review: https://git.openjdk.org/jdk/pull/23183#pullrequestreview-2575509254
PR Review Comment: https://git.openjdk.org/jdk/pull/23183#discussion_r1930571433
PR Review Comment: https://git.openjdk.org/jdk/pull/23183#discussion_r1930595439
PR Review Comment: https://git.openjdk.org/jdk/pull/23183#discussion_r1930596373


More information about the client-libs-dev mailing list