diff options
author | Remy Suen | 2010-05-13 22:52:47 +0000 |
---|---|---|
committer | Remy Suen | 2010-05-13 22:52:47 +0000 |
commit | f82d1a0dbfde2fa2ce5d971773a554ee694ac408 (patch) | |
tree | 1aa28b2b64e000a3ab4527b4c980ab113ad212db | |
parent | 708aa2d18f58c7a9655045b6fe5d0483fde89e6e (diff) | |
download | egit-f82d1a0dbfde2fa2ce5d971773a554ee694ac408.tar.gz egit-f82d1a0dbfde2fa2ce5d971773a554ee694ac408.tar.xz egit-f82d1a0dbfde2fa2ce5d971773a554ee694ac408.zip |
Ignore secondary mouse clicks in the 'History' view's hyperlinks
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.java | 5 |
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 d19aacb54e..6f80fa6105 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)); |