applyAsFullScreenPresentationOptions method

void applyAsFullScreenPresentationOptions({
  1. bool force = false,
})

Applies these NSAppPresentationOptions to as fullscreen presentation options.

These NSAppPresentationOptions must include NSAppPresentationOption.fullScreen.

Throws an assertion error if any of the following restrictions is violated:

  • autoHideDock and hideDock are mutually exclusive: You may specify one or the other, but not both.
  • autoHideMenuBar and hideMenuBar are mutually exclusive: You may specify one or the other, but not both.
  • If you specify hideMenuBar, it must be accompanied by hideDock.
  • If you specify autoHideMenuBar, it must be accompanied by either hideDock or autoHideDock.
  • If you specify any of disableProcessSwitching, disableForceQuit, disableSessionTermination, or disableMenuBarTransparency, it must be accompanied by either hideDock or autoHideDock.
  • autoHideToolbar may be used only when both fullScreen and autoHideMenuBar are also set.

If the force flag is true, those assertions are disabled.

Implementation

void applyAsFullScreenPresentationOptions({bool force = false}) {
  if (!force) {
    assertRestrictions();

    assert(contains(NSAppPresentationOption.fullScreen),
        'fullScreen must be set.');
  }

  WindowManipulator.removeFullScreenPresentationOptions();
  for (final option in options) {
    WindowManipulator.addFullScreenPresentationOption(option);
  }
}