IDEA-116760 Mousing over "tool popup" button causes funny behavior

This commit is contained in:
Vassiliy
2014-03-04 22:22:33 +04:00
parent ece83110e3
commit fb14201173
@@ -72,8 +72,13 @@ class ToolWindowsWidget extends JLabel implements CustomStatusBarWidget, StatusB
@Override
public boolean dispatch(AWTEvent e) {
if (e instanceof MouseEvent) {
MouseEvent mouseEvent = (MouseEvent)e;
if (mouseEvent.getComponent() == null || !SwingUtilities.isDescendingFrom(mouseEvent.getComponent(), SwingUtilities.getWindowAncestor(ToolWindowsWidget.this))) {
return false;
}
if (e.getID() == MouseEvent.MOUSE_MOVED && isShowing()) {
Point p = ((MouseEvent)e).getLocationOnScreen();
Point p = mouseEvent.getLocationOnScreen();
Point screen = ToolWindowsWidget.this.getLocationOnScreen();
if (new Rectangle(screen.x - 4, screen.y - 2, getWidth() + 4, getHeight() + 4).contains(p)) {
mouseEntered();
@@ -85,7 +90,7 @@ class ToolWindowsWidget extends JLabel implements CustomStatusBarWidget, StatusB
}
} else if (e.getID() == MouseEvent.MOUSE_EXITED) {
//mouse exits WND
mouseExited(((MouseEvent)e).getLocationOnScreen());
mouseExited(mouseEvent.getLocationOnScreen());
}
}
return false;