diff --git a/platform/platform-api/src/com/intellij/ui/MouseDragHelper.java b/platform/platform-api/src/com/intellij/ui/MouseDragHelper.java index 4cfb75aec780..67f78579e660 100644 --- a/platform/platform-api/src/com/intellij/ui/MouseDragHelper.java +++ b/platform/platform-api/src/com/intellij/ui/MouseDragHelper.java @@ -37,7 +37,8 @@ public abstract class MouseDragHelper implements MouseListener, MouseMotionListe private final JComponent myDragComponent; - protected Point myPressPointScreen; + private Point myPressPointScreen; + protected Point myPressedOnScreenPoint; private Point myPressPointComponent; private boolean myDraggingNow; @@ -114,6 +115,7 @@ public abstract class MouseDragHelper implements MouseListener, MouseMotionListe if (!canStartDragging(e)) return; myPressPointScreen = new RelativePoint(e).getScreenPoint(); + myPressedOnScreenPoint = new Point(myPressPointScreen); myPressPointComponent = e.getPoint(); processMousePressed(e); @@ -131,6 +133,7 @@ public abstract class MouseDragHelper implements MouseListener, MouseMotionListe return; } boolean wasDragging = myDraggingNow; + myPressPointScreen = null; myDraggingNow = false; myDragJustStarted = false; @@ -143,7 +146,7 @@ public abstract class MouseDragHelper implements MouseListener, MouseMotionListe } } finally { - myPressPointScreen = null; + myPressedOnScreenPoint = null; resetDragState(); e.consume(); if (myDetachPostponed) { diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/DragHelper.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/DragHelper.java index 528c5bdf8648..3ba5cd0b381d 100644 --- a/platform/platform-api/src/com/intellij/ui/tabs/impl/DragHelper.java +++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/DragHelper.java @@ -243,7 +243,7 @@ class DragHelper extends MouseDragHelper { if (!willDragOutStart && JBEditorTabs.isAlphabeticalMode() && position != JBTabsPosition.top && position != JBTabsPosition.bottom) { Point p = new Point(event.getPoint()); p = SwingUtilities.convertPoint(event.getComponent(), p, myTabs); - if (myTabs.getVisibleRect().contains(p) && myPressPointScreen.distance(new RelativePoint(event).getScreenPoint()) > 15) { + if (myTabs.getVisibleRect().contains(p) && myPressedOnScreenPoint.distance(new RelativePoint(event).getScreenPoint()) > 15) { final int answer = Messages.showOkCancelDialog(myTabs, IdeBundle.message("alphabetical.mode.is.on.warning"), IdeBundle.message("title.warning"),