From 1a1d93d60aae314f1d4c6390c3d0c7b321609d7c Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 22 Nov 2016 19:24:54 +0100 Subject: [PATCH] IDEA-164290 File structure popup quickly disappears when called via Find action --- .../src/com/intellij/ide/actions/GotoActionAction.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/GotoActionAction.java b/platform/lang-impl/src/com/intellij/ide/actions/GotoActionAction.java index 296122d82707..2a86b74c29ed 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/GotoActionAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/GotoActionAction.java @@ -45,6 +45,7 @@ import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.ui.popup.ListPopup; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.Pair; +import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.psi.PsiFile; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; @@ -89,7 +90,7 @@ public class GotoActionAction extends GotoActionBase implements DumbAware { @NotNull final GotoActionModel model, String initialText, int initialIndex, - final Component component, + final Component component, final AnActionEvent e) { ChooseByNamePopup oldPopup = project == null ? null : project.getUserData(ChooseByNamePopup.CHOOSE_BY_NAME_POPUP_IN_PROJECT_KEY); if (oldPopup != null) { @@ -207,7 +208,7 @@ public class GotoActionAction extends GotoActionBase implements DumbAware { }); CustomShortcutSet shortcutSet = new CustomShortcutSet(KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_SHOW_INTENTION_ACTIONS)); - + new DumbAwareAction() { @Override public void actionPerformed(AnActionEvent e) { @@ -267,7 +268,8 @@ public class GotoActionAction extends GotoActionBase implements DumbAware { ShowSettingsUtilImpl.showSettingsDialog(project, configurableId, enteredText)); } else { - performAction(element, component, e); + ApplicationManager.getApplication().invokeLater(() -> IdeFocusManager.getInstance(project).doWhenFocusSettlesDown( + () -> performAction(element, component, e))); } }