public static @Nullable Object getPlatformWindow(@NotNull Window w) {
    if (SystemInfo.isJetBrainsJvm) {
      try {
        Class<?> awtAccessor = Class.forName("sun.awt.AWTAccessor");
        Object componentAccessor = awtAccessor.getMethod("getComponentAccessor").invoke(null);
        Method getPeer = componentAccessor.getClass().getMethod("getPeer", Component.class);
        getPeer.setAccessible(true);
        Object peer = getPeer.invoke(componentAccessor, w);
        if (peer != null) {
          Class<?> cWindowPeerClass = peer.getClass();
          Method getPlatformWindowMethod = cWindowPeerClass.getDeclaredMethod("getPlatformWindow");
          Object cPlatformWindow = getPlatformWindowMethod.invoke(peer);
          if (cPlatformWindow != null) {
            return cPlatformWindow;
          }
        }
      }
      catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | ClassNotFoundException e) {
        LOG.debug(e);
      }
    }
    return null;
  }
public static @Nullable Object getPlatformWindow(@NotNull Window w)