Ctrl-drag of editor tab leaves a copy in the original container (IDEA-80651)

This commit is contained in:
Dmitry Jemerov
2012-02-02 19:58:30 +01:00
parent fe59354aec
commit ee88a167f4
2 changed files with 8 additions and 2 deletions
@@ -73,7 +73,7 @@ class DragHelper extends MouseDragHelper {
protected void processDragOutFinish(MouseEvent event) {
super.processDragOutFinish(event);
myDragOutSource.getDragOutDelegate().dragOutFinished(event, myDragSource);
myDragOutSource.getDragOutDelegate().dragOutFinished(event, myDragOutSource);
}
protected void processDrag(MouseEvent event, Point targetScreenPoint, Point startPointScreen) {
@@ -567,7 +567,13 @@ final class EditorTabbedContainer implements Disposable, CloseAction.CloseTarget
@Override
public void dragOutFinished(MouseEvent event, TabInfo source) {
FileEditorManagerEx.getInstanceEx(myProject).closeFile(myFile, myWindow);
boolean copy = event.isMetaDown() || (!SystemInfo.isMac && event.isControlDown());
if (!copy) {
FileEditorManagerEx.getInstanceEx(myProject).closeFile(myFile, myWindow);
}
else {
source.setHidden(false);
}
mySession.process(event);