diff options
author | Tor Norbye <tnorbye@google.com> | 2010-11-11 15:27:11 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2010-11-11 15:27:11 -0800 |
commit | 3d3062da8dbbe62c0bb2ed02b36c20ea4ee23991 (patch) | |
tree | 02e4d4539b15a9a4dced520e1abbb15615fd7ecb | |
parent | 544f82284a7832b8f76f191b23a89c5ab12dba4c (diff) | |
download | sdk-3d3062da8dbbe62c0bb2ed02b36c20ea4ee23991.zip sdk-3d3062da8dbbe62c0bb2ed02b36c20ea4ee23991.tar.gz sdk-3d3062da8dbbe62c0bb2ed02b36c20ea4ee23991.tar.bz2 |
Fix issue 12251: double click handling
Surprisingly, SWT will deliver a double click event even if you click
button 1 then 3 in rapid succession. This changeset ensures that only
a double click on button 1 warps to XML.
Change-Id: I2b470e2dea5bdb4c9240c9304650ca1c7403db84
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java index 9da3599..585f354 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java @@ -332,7 +332,12 @@ public class GestureManager { } public void mouseDoubleClick(MouseEvent e) { - mCanvas.showXml(e); + // SWT delivers a double click event even if you click two different buttons + // in rapid succession. In any case, we only want to let you double click the + // first button to warp to XML: + if (e.button == 1) { + mCanvas.showXml(e); + } } // --- KeyListener --- |