Skip to content

Commit 6d76dea

Browse files
andy-goryachev-oraclekevinrushforth
authored andcommittedJul 15, 2022
8289611: MouseLocationOnScreenTest sometimes fails on Mac M1
Reviewed-by: kcr
1 parent b5e4049 commit 6d76dea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎tests/system/src/test/java/test/robot/javafx/scene/MouseLocationOnScreenTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,8 @@ public static void initFX() {
7373
public void testMouseLocation() throws Exception {
7474

7575
Screen screen = Screen.getPrimary();
76-
Rectangle2D bounds = screen.getBounds();
76+
// using visual bounds prevents hitting the camera notch area on newer Macs
77+
Rectangle2D bounds = screen.getVisualBounds();
7778
int x1 = (int) bounds.getMinX();
7879
int x2 = (int) (x1 + bounds.getWidth() - 1);
7980
int y1 = (int) bounds.getMinY();

0 commit comments

Comments
 (0)