mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-152991 ignore mouse motion event if mouse location on screen is not really changed
This commit is contained in:
@@ -439,9 +439,20 @@ public class ListPopupImpl extends WizardPopup implements ListPopup {
|
||||
|
||||
private class MyMouseMotionListener extends MouseMotionAdapter {
|
||||
private int myLastSelectedIndex = -2;
|
||||
private Point myLastMouseLocation;
|
||||
|
||||
private boolean isMouseMoved(Point location) {
|
||||
if (myLastMouseLocation == null) {
|
||||
myLastMouseLocation = location;
|
||||
return false;
|
||||
}
|
||||
return !myLastMouseLocation.equals(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
if (!isMouseMoved(e.getLocationOnScreen())) return;
|
||||
|
||||
Point point = e.getPoint();
|
||||
int index = myList.locationToIndex(point);
|
||||
|
||||
|
||||
@@ -249,8 +249,20 @@ public class TreePopupImpl extends WizardPopup implements TreePopup {
|
||||
}
|
||||
|
||||
private class MyMouseMotionListener extends MouseMotionAdapter {
|
||||
private Point myLastMouseLocation;
|
||||
|
||||
private boolean isMouseMoved(Point location) {
|
||||
if (myLastMouseLocation == null) {
|
||||
myLastMouseLocation = location;
|
||||
return false;
|
||||
}
|
||||
return !myLastMouseLocation.equals(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMoved(MouseEvent e) {
|
||||
if (!isMouseMoved(e.getLocationOnScreen())) return;
|
||||
|
||||
final TreePath path = getPath(e);
|
||||
if (path != null) {
|
||||
myWizardTree.setSelectionPath(path);
|
||||
|
||||
Reference in New Issue
Block a user