From 087342491627b45606572ff19424c423557cde8a Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Tue, 28 Jun 2016 19:58:57 +0300 Subject: [PATCH 1/3] IDEA-144702 Unable to use Windows as a modifier key in keymap ROLLBACK (registry key now is false by default) because of tons of native and semi-native bugs --- platform/util/resources/misc/registry.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 72e211cfd5a5..678daf053711 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -318,7 +318,7 @@ find.search.in.project.files=true structureView.coalesceTime=500 keymap.show.alias.actions=false -keymap.windows.as.meta=true +keymap.windows.as.meta=false frameworks.download.libraries.server.url=http://pluginsrepo-test:8080 caches.indexerThreadsCount=-1 navBar.updateMergeTime=100 From b886782695e932fb8d0ed2b11eb92d4faf3e73e0 Mon Sep 17 00:00:00 2001 From: irengrig Date: Tue, 28 Jun 2016 20:20:56 +0200 Subject: [PATCH 2/3] WEB-22184 angular-ui-router: UnsupportedOperationException when press cmd+d --- .../src/com/intellij/diff/actions/CompareFilesAction.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/diff-impl/src/com/intellij/diff/actions/CompareFilesAction.java b/platform/diff-impl/src/com/intellij/diff/actions/CompareFilesAction.java index e0d802ccf0d8..39f47ddda532 100644 --- a/platform/diff-impl/src/com/intellij/diff/actions/CompareFilesAction.java +++ b/platform/diff-impl/src/com/intellij/diff/actions/CompareFilesAction.java @@ -83,16 +83,20 @@ public class CompareFilesAction extends BaseShowDiffAction { } if (files.length == 1) { - return files[0].isValid(); + return isValidAndLocal(files[0]); } else if (files.length == 2) { - return files[0].isValid() && files[1].isValid(); + return isValidAndLocal(files[0]) && isValidAndLocal(files[1]); } else { return false; } } + private static boolean isValidAndLocal(VirtualFile file) { + return file.isValid() && file.isInLocalFileSystem(); + } + @Nullable @Override protected DiffRequest getDiffRequest(@NotNull AnActionEvent e) { From 95b14d18e22c1e20803d93cb4c9fa125652ab436 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 28 Jun 2016 17:41:14 +0200 Subject: [PATCH 3/3] DragHelper: don't leak the last mouse-pressed editor tab after it's closed --- .../com/intellij/ui/tabs/impl/DragHelper.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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 b0df0917dfe0..8c3cc72f683c 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 @@ -17,6 +17,7 @@ package com.intellij.ui.tabs.impl; import com.intellij.ide.IdeBundle; import com.intellij.openapi.ui.Messages; +import com.intellij.reference.SoftReference; import com.intellij.ui.InplaceButton; import com.intellij.ui.MouseDragHelper; import com.intellij.ui.ScreenUtil; @@ -29,6 +30,8 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; import java.awt.event.MouseEvent; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; class DragHelper extends MouseDragHelper { @@ -40,7 +43,7 @@ class DragHelper extends MouseDragHelper { private Dimension myHoldDelta; private TabInfo myDragOutSource; - private TabLabel myPressedTabLabel; + private Reference myPressedTabLabel; public DragHelper(JBTabsImpl tabs) { super(tabs, tabs); @@ -57,10 +60,8 @@ class DragHelper extends MouseDragHelper { int dX = dragToScreenPoint.x - startScreenPoint.x; int dY = dragToScreenPoint.y - startScreenPoint.y; - boolean dragOut = - myTabs.getEffectiveLayout().isDragOut(label, dX, dY); - return dragOut; + return myTabs.getEffectiveLayout().isDragOut(label, dX, dY); } @Override @@ -90,7 +91,8 @@ class DragHelper extends MouseDragHelper { protected void processMousePressed(MouseEvent event) { // since selection change can cause tabs to be reordered, we need to remember the tab on which the mouse was pressed, otherwise // we'll end up dragging the wrong tab (IDEA-65073) - myPressedTabLabel = findLabel(new RelativePoint(event).getPoint(myTabs)); + TabLabel label = findLabel(new RelativePoint(event).getPoint(myTabs)); + myPressedTabLabel = label == null ? null : new WeakReference(label); } protected void processDrag(MouseEvent event, Point targetScreenPoint, Point startPointScreen) { @@ -99,12 +101,13 @@ class DragHelper extends MouseDragHelper { SwingUtilities.convertPointFromScreen(startPointScreen, myTabs); if (isDragJustStarted()) { - if (myPressedTabLabel == null) return; + TabLabel pressedTabLabel = SoftReference.dereference(myPressedTabLabel); + if (pressedTabLabel == null) return; - final Rectangle labelBounds = myPressedTabLabel.getBounds(); + final Rectangle labelBounds = pressedTabLabel.getBounds(); myHoldDelta = new Dimension(startPointScreen.x - labelBounds.x, startPointScreen.y - labelBounds.y); - myDragSource = myPressedTabLabel.getInfo(); + myDragSource = pressedTabLabel.getInfo(); myDragRec = new Rectangle(startPointScreen, labelBounds.getSize()); myDragOriginalRec = (Rectangle)myDragRec.clone();