macOS 10.10 fullscreen/kiosk mode fix

Hi folks,

I just ran into a little issue with using fullscreen/kiosk mode on macOS 10.10.

  1. the menu bar isn’t visible when leaving fullscreen mode.

This is how I’m entering fullscreen mode:
Desktop::getInstance().setKioskModeComponent(_movieFullscreenWindow.get(), false);

I need to pass “false” as otherwise the menu bar will stay visible. This seems to be a 10.10 problem. It’s not the case for 10.12-10.14.

Fixing the issue is however rather easy. We just need to set the default presentation options when leaving fullscreen mode.

    if (peer->hasNativeTitleBar()
          && [peer->window respondsToSelector: @selector (toggleFullScreen:)])
        if (shouldBeEnabled && !allowMenusAndBars)
            [NSApp setPresentationOptions: NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar];
        else if (!shouldBeEnabled)
            [NSApp setPresentationOptions: NSApplicationPresentationDefault];

        [peer->window performSelector: @selector (toggleFullScreen:) withObject: nil];

Hope this helps!

Thanks, I’ll get this added.