boolean (final Project project) { final Component focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent(project); boolean fromQuickSearch = focusedComponent != null && focusedComponent.getParent() instanceof ChooseByNameBase.JPanelProvider; return !fromQuickSearch && LookupManager.getInstance(project).getActiveLookup() == null; }