@Nullable
  public static Window getCurrentWindow(@NotNull Project project) {
    Window window = null;

    WindowManagerEx manager = getWndManager();
    if (manager != null) {
      window = getTargetWindow(manager.getFocusedComponent(project));
    }
    if (window == null) {
      window = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow();
    }
    if ((window == null || !window.isShowing()) && manager != null) {
      window = manager.getFrame(project);
    }

    return window;
  }
@Nullable
  public static Window getCurrentWindow(@NotNull Project project)