OSDN Git Service

GLE2: Don't change the selection on right click > menu.
authorRaphael Moll <ralf@android.com>
Tue, 7 Sep 2010 20:57:36 +0000 (13:57 -0700)
committerRaphael Moll <ralf@android.com>
Wed, 8 Sep 2010 18:15:09 +0000 (11:15 -0700)
Change-Id: I94c4a1bc57287d250963456339aa24e6a10a92c0

eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java

index e9708f2..4de76f9 100755 (executable)
@@ -1059,6 +1059,14 @@ class LayoutCanvas extends Canvas implements ISelectionProvider {
      * pointed at (i.e. click on an object then alt-click to cycle).
      */
     private void onMouseUp(MouseEvent e) {
+
+        // Only perform selection when mouse button 1 is used.
+        // This prevents right-click from also changing the selection, since it's
+        // used to display a context menu that depends on the current selection.
+        if (e.button != 1) {
+            return;
+        }
+
         boolean isShift = (e.stateMask & SWT.SHIFT) != 0;
         boolean isAlt   = (e.stateMask & SWT.ALT)   != 0;