private boolean isAppActive() {
      Application app = ApplicationManager.getApplication();
      if (app == null || myAppListener != null) {
        return app != null && app.isActive();
      }

      myAppListener = new ApplicationActivationListener() {
        @Override
        public void applicationActivated(@NotNull IdeFrame ideFrame) {
          JFrame frame;
          if (ideFrame instanceof JFrame) {
            frame = (JFrame)ideFrame;
          }
          else {
            frame = ((ProjectFrameHelper)ideFrame).getFrame();
          }

          if (isProgressAppIconEnabled()) {
            _hideProgress(frame, myCurrentProcessId);
          }
          _setOkBadge(frame, false);
          _setTextBadge(frame, null);
        }
      };
      app.getMessageBus().connect().subscribe(ApplicationActivationListener.TOPIC, myAppListener);
      return app.isActive();
    }
private boolean isAppActive()