Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2015-09-15 17:23:46 -0400
committerMatthias Sohn2015-09-17 02:35:28 -0400
commit6d548e3038a6f8f94943d3cc8870b78e0fb20544 (patch)
tree4cd3b1a478973b07f1c0c24cfc44c45f7a7aa71c
parent9f9a9e7b65237d6a3f88cb7358fc6be6729f7c65 (diff)
downloadegit-6d548e3038a6f8f94943d3cc8870b78e0fb20544.tar.gz
egit-6d548e3038a6f8f94943d3cc8870b78e0fb20544.tar.xz
egit-6d548e3038a6f8f94943d3cc8870b78e0fb20544.zip
Focus file list in GitHistoryView when context menu is shown
Force focus to CommitFileDiffViewer to ensure that the "Show In" submenu works. Bug: 477510 Change-Id: I4faddbda611d2f9d2cbf743b8ac6545dcb1e5e51 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
index f544fb87f..8e83b5012 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
@@ -40,6 +40,8 @@ import org.eclipse.egit.ui.internal.blame.BlameOperation;
import org.eclipse.egit.ui.internal.revision.GitCompareFileRevisionEditorInput;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -307,6 +309,13 @@ public class CommitFileDiffViewer extends TableViewer {
mgr.add(selectAll = createStandardAction(ActionFactory.SELECT_ALL));
mgr.add(copy = createStandardAction(ActionFactory.COPY));
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=477510
+ mgr.addMenuListener(new IMenuListener() {
+ @Override
+ public void menuAboutToShow(IMenuManager manager) {
+ getControl().setFocus();
+ }
+ });
if (site instanceof IPageSite) {
final IPageSite pageSite = (IPageSite) site;
getControl().addFocusListener(new FocusListener() {

Back to the top