-- (void)setFullscreen:(int)i_full forWindow:(vout_window_t *)p_wnd
-{
- if (!p_intf || (!b_nativeFullscreenMode && !p_wnd))
- return;
- playlist_t * p_playlist = pl_Get(p_intf);
- BOOL b_fullscreen = i_full;
-
- if (!var_GetBool(p_playlist, "fullscreen") != !b_fullscreen) {
- var_SetBool(p_playlist, "fullscreen", b_fullscreen);
- }
-
- if (b_nativeFullscreenMode) {
- // this is called twice in certain situations, so only toogle if we really need to
- if ((b_fullscreen && !([NSApp currentSystemPresentationOptions] & NSApplicationPresentationFullScreen)) ||
- (!b_fullscreen && ([NSApp currentSystemPresentationOptions] & NSApplicationPresentationFullScreen)))
- [o_mainwindow toggleFullScreen: self];
-
- if (b_fullscreen)
- [NSApp setPresentationOptions:(NSApplicationPresentationFullScreen | NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)];
- else
- [NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
- } else {
- assert(p_wnd);
-
- if (b_fullscreen) {
- input_thread_t * p_input = pl_CurrentInput(p_intf);
- if (p_input != NULL && [self activeVideoPlayback]) {
- // activate app, as method can also be triggered from outside the app (prevents nasty window layout)
- [NSApp activateIgnoringOtherApps:YES];
- [o_vout_controller updateWindow:p_wnd withSelector:@selector(enterFullscreen)];
-
- }
- if (p_input)
- vlc_object_release(p_input);
- } else {
- // leaving fullscreen is always allowed
- [o_vout_controller updateWindow:p_wnd withSelector:@selector(leaveFullscreen)];
- }
- }
-}