private static @NotNull Job tweakFrameFullScreen(Project project, boolean inPresentation) {
    ProjectFrameHelper frame = ProjectFrameHelper.getFrameHelper(IdeFrameImpl.getActiveFrame());
    if (frame == null) {
      return CompletableDeferredKt.CompletableDeferred(Unit.INSTANCE);
    }

    if (SystemInfo.isMac) {
      MacFullScreenControlsManager.INSTANCE.updateForPresentationMode();
    }

    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(project);
    if (inPresentation) {
      propertiesComponent.setValue("full.screen.before.presentation.mode", String.valueOf(frame.isInFullScreen()));
      return frame.toggleFullScreen(true);
    }
    else if (frame.isInFullScreen()) {
      final String value = propertiesComponent.getValue("full.screen.before.presentation.mode");
      return frame.toggleFullScreen("true".equalsIgnoreCase(value));
    }
    return CompletableDeferredKt.CompletableDeferred(Unit.INSTANCE);
  }
private static @NotNull Job tweakFrameFullScreen(Project project, boolean inPresentation)