From a4da2060c8e0b029b9f414106d6846013b8cb2ee Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Mon, 4 Nov 2013 17:24:33 +0100 Subject: [PATCH] can't call actions by mouse --- .../intellij/ide/actions/SearchEverywhereAction.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java index 89e2b11b4b75..c63edeb988c6 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java @@ -336,7 +336,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA private void initSearchField(final MySearchTextField search) { final JTextField editor = search.getTextEditor(); - onFocusLost(); +// onFocusLost(); editor.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { @@ -379,7 +379,8 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA @Override public void focusLost(FocusEvent e) { - if ( myPopup instanceof AbstractPopup && myPopup.isVisible() && ((AbstractPopup)myPopup).getPopupWindow() == e.getOppositeComponent()) { + if ( myPopup instanceof AbstractPopup && myPopup.isVisible() + && ((myList == e.getOppositeComponent()) || ((AbstractPopup)myPopup).getPopupWindow() == e.getOppositeComponent())) { return; } onFocusLost(); @@ -491,7 +492,11 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA option.setOptionState(!option.isOptionEnabled()); } else { - GotoActionAction.openOptionOrPerformAction(value, pattern, project, comp, event); + Component c = comp; + if (c == null) { + c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); + } + GotoActionAction.openOptionOrPerformAction(value, pattern, project, c, event); } } });