private void hidePopupsIfNeeded() {
    if (!SystemInfoRt.isMac) {
      return;
    }

    StackingPopupDispatcher stackingPopupDispatcher = StackingPopupDispatcher.getInstance();
    stackingPopupDispatcher.hidePersistentPopups();

    Disposer.register(myDialog, new Disposable() {
      @Override
      public void dispose() {
        stackingPopupDispatcher.restorePersistentPopups();
      }
    });
  }
private void hidePopupsIfNeeded()