public @Nullable Window suggestParentWindow(@Nullable Project project, @NotNull WindowManagerEx windowManager) {
    synchronized (myLock) {
      Window window = getFocusedWindowForProject(project);
      if (window == null) {
        if (project == null) {
          Project[] projects = ProjectUtil.getOpenProjects();
          if (projects.length == 1) {
            project = projects[0];
          }
        }
        if (project == null) {
          return null;
        }
        else {
          IdeFrame frame = windowManager.findFrameFor(project);
          if (frame == null) {
            return null;
          }
          else if (frame instanceof Window) {
            return (Window)frame;
          }
          else {
            return ((ProjectFrameHelper)frame).getFrame();
          }
        }
      }

      LOG.assertTrue(window.isDisplayable());
      LOG.assertTrue(window.isShowing());

      while (window != null) {
        // skip not visible and disposed/not shown windows
        if (!window.isDisplayable() || !window.isShowing()) {
          window = window.getOwner();
          continue;
        }
        // skip windows that have not associated WindowInfo
        final WindowInfo info = windowToInfo.get(window);
        if (info == null) {
          window = window.getOwner();
          continue;
        }
        if (info.mySuggestAsParent) {
          return window;
        }
        else {
          window = window.getOwner();
        }
      }
      return null;
    }
  }
public @Nullable Window suggestParentWindow(@Nullable Project project, @NotNull WindowManagerEx windowManager)