void performOnCancel(@NotNull Runnable runnable) {
    performWhenAvailable(popup -> popup.addListener(new JBPopupListener() {
      @Override
      public void onClosed(@NotNull LightweightWindowEvent event) {
        runnable.run();
      }
    }));
  }
void performOnCancel(@NotNull Runnable runnable)