private static boolean canBeHiddenBehind(@NotNull Window window) {
    if (!(window instanceof Frame)) return false;
    if (SystemInfo.isMac) {
      if (window instanceof IdeFrame) {
        // we can't move focus to full-screen main frame, as it will be hidden behind other frame windows
        Project project = ((IdeFrame)window).getProject();
        IdeFrame projectFrame = WindowManager.getInstance().getIdeFrame(project);
        if (projectFrame != null) {
          JComponent projectFrameComponent = projectFrame.getComponent();
          if (projectFrameComponent != null) {
            return !projectFrame.isInFullScreen() ||
                   window.getGraphicsConfiguration().getDevice() != projectFrameComponent.getGraphicsConfiguration().getDevice();
          }
        }
      }
    }
    return true;
  }
private static boolean canBeHiddenBehind(@NotNull Window window)