private @Nullable Window getFocusedWindowForProject(final @Nullable Project project) {
    //todo[anton,vova]: it is possible that returned wnd is not contained in myFocusedWindows; investigate
    outer:
    for (Window window : myFocusedWindows) {
      while (!window.isDisplayable() || !window.isShowing()) { // if window isn't visible then gets its first visible ancestor
        window = window.getOwner();
        if (window == null) {
          continue outer;
        }
      }
      final DataContext dataContext = DataManager.getInstance().getDataContext(window);
      if (project == CommonDataKeys.PROJECT.getData(dataContext)) {
        return window;
      }
    }
    return null;
  }
private @Nullable Window getFocusedWindowForProject(final @Nullable Project project)