IDEA-164290 File structure popup quickly disappears when called via Find action

This commit is contained in:
peter
2016-11-22 19:47:18 +01:00
parent ab483869ec
commit 1a1d93d60a
@@ -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)));
}
}