@Override
  public void beforeModalityStateChanged(boolean entering, @NotNull Object modalEntity) {
    SwingUtilities.invokeLater(() -> maybeReady());
  }
@Override
  public void beforeModalityStateChanged(boolean entering, @NotNull Object modalEntity)