mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-121220 Focus remains on Document tabs instead of Editor area when tabs switching
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user