if (subMenu != null && subMenu.isVisible()) {
Point xy = ce.<XEvent> cast().getXY();
xy.setX(xy.getX() + XDOM.getBodyScrollLeft());
xy.setY(xy.getY() + XDOM.getBodyScrollTop());
Rectangle rec = subMenu.getElement().getBounds();
if (getLayer(subMenu) != null) {
Layer l = getLayer(subMenu);
if (l.isShim() && l.isShadow()) {
return !rec.contains(xy) && !l.getShadow().getBounds().contains(xy)
&& !l.getShim().getBounds().contains(xy);
} else if (l.isShadow()) {
return !rec.contains(xy) && !l.getShadow().getBounds().contains(xy);
} else if (l.isShim()) {
return !rec.contains(xy) && !l.getShim().getBounds().contains(xy);
}
}
return !rec.contains(xy);
}
}
return true;
}