summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRemy Suen2010-05-13 18:52:47 (EDT)
committer Remy Suen2010-05-13 18:52:47 (EDT)
commitf82d1a0dbfde2fa2ce5d971773a554ee694ac408 (patch)
tree1aa28b2b64e000a3ab4527b4c980ab113ad212db
parent708aa2d18f58c7a9655045b6fe5d0483fde89e6e (diff)
downloadegit-f82d1a0dbfde2fa2ce5d971773a554ee694ac408.zip
egit-f82d1a0dbfde2fa2ce5d971773a554ee694ac408.tar.gz
egit-f82d1a0dbfde2fa2ce5d971773a554ee694ac408.tar.bz2
Ignore secondary mouse clicks in the 'History' view's hyperlinksrefs/changes/98/698/1
Only the primary mouse click should be acknowledged as a request to jump to another commit when browsing commits in the 'History' view. At the moment, users that want to select the commit id and copy the id to the clipboard through the context menu might actually end up jumping to the selected commit as the secondary mouse click is processed as a hyperlink request. Change-Id: I8351cbda039419160e6731e307fa7243a3be90d4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java
index d19aacb..6f80fa6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java
@@ -107,6 +107,11 @@ class CommitMessageViewer extends TextViewer implements ISelectionChangedListene
t.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(final MouseEvent e) {
+ // only process the hyperlink if it was a primary mouse click
+ if (e.button != 1) {
+ return;
+ }
+
final int o;
try {
o = t.getOffsetAtLocation(new Point(e.x, e.y));