8283215: [macos] Screen Magnifier: Getting java.awt.IllegalComponentStateException when menu item is selected
Reviewed-by: serb, prr
This commit is contained in:
parent
86caf606ff
commit
9440b39193
@ -28,6 +28,7 @@ package sun.lwawt.macosx;
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.IllegalComponentStateException;
|
||||
import java.awt.KeyboardFocusManager;
|
||||
import java.awt.Point;
|
||||
import java.awt.Window;
|
||||
@ -469,7 +470,16 @@ class CAccessibility implements PropertyChangeListener {
|
||||
public static Accessible accessibilityHitTest(final Container parent, final float hitPointX, final float hitPointY) {
|
||||
return invokeAndWait(new Callable<Accessible>() {
|
||||
public Accessible call() throws Exception {
|
||||
final Point p = parent.getLocationOnScreen();
|
||||
if (parent == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final Point p;
|
||||
try {
|
||||
p = parent.getLocationOnScreen();
|
||||
} catch (IllegalComponentStateException ice) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Make it into local coords
|
||||
final Point localPoint = new Point((int)(hitPointX - p.getX()), (int)(hitPointY - p.getY()));
|
||||
|
Loading…
Reference in New Issue
Block a user