On Thu, 20 Apr 2023 12:22:54 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

>> Usage of `getBounds()` method instead `getVisualBounds()` was giving 
>> unreliable screen bound values and color value was read very close to the 
>> edge of the window.
>> 
>> Updated the code to use `getVisualBounds()` instead of `getBounds()` and 
>> moved the coordinates inside the window from where the color value is read.
>> 
>> Ran the tests individually and along with all system tests in following 
>> systems. No failure found after the fix.
>> Mac M1 with Ventura 13.3
>> Window 11
>
> tests/system/src/test/java/test/robot/helloworld/CustomSecurityManagerTest.java
>  line 202:
> 
>> 200:                 if (row == 0) {
>> 201:                     // avoid the top area as it might contain 
>> OS-specific UI (Macs with a notch)
>> 202:                     y = h / 3;
> 
> Now that this tests uses visualBounds, there is no need to worry about 
> avoiding the top, so this can be something like "y = 4".

When the app enters full screen mode in MacBook Pro M1, there will be still a 
black strip on the top because of the notch. So assigning small value will not 
fetch green color from app window. It requires at least y=40.
So I think we can add new static final variable with a value of 40 or 50 to be 
on the safer side and use it in all the places so that it works for all the 
cases.
Please let me know your thought on this.

> tests/system/src/test/java/test/robot/helloworld/CustomSecurityManagerTest.java
>  line 208:
> 
>> 206: 
>> 207:                 for (int col = 0; col < 2; col++) {
>> 208:                     int x = col == 0 ? 1 : screenWidth.get() - 5;
> 
> For `col == 0` you might want to change the value from `1` to `4` for the 
> same reason you changed the second value.

If static final variable with a suitable value is added as mentioned above, 
same variable can be used here.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1103#discussion_r1172688252
PR Review Comment: https://git.openjdk.org/jfx/pull/1103#discussion_r1172689462

Reply via email to