]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/misc.m
macosx: deduplicate code for fullscreen presentation options
[vlc] / modules / gui / macosx / misc.m
index 01c8e5e1d2a7c54151dec3db8044ce1a377c0d0a..4d07d8e2df8aecb514394f4431b5c4913d0718b8 100644 (file)
@@ -246,12 +246,7 @@ static NSMutableArray *blackoutWindows = NULL;
         [blackoutWindows addObject: blackoutWindow];
         [blackoutWindow release];
 
-        NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions];
-        if ([screen hasMenuBar])
-            presentationOpts |= NSApplicationPresentationAutoHideMenuBar;
-        if ([screen hasMenuBar] || [screen hasDock])
-            presentationOpts |= NSApplicationPresentationAutoHideDock;
-        [NSApp setPresentationOptions:presentationOpts];
+        [screen setFullscreenPresentationOptions];
     }
 }
 
@@ -267,6 +262,16 @@ static NSMutableArray *blackoutWindows = NULL;
     [NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
 }
 
+- (void)setFullscreenPresentationOptions
+{
+    NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions];
+    if ([self hasMenuBar])
+        presentationOpts |= NSApplicationPresentationAutoHideMenuBar;
+    if ([self hasMenuBar] || [self hasDock])
+        presentationOpts |= NSApplicationPresentationAutoHideDock;
+    [NSApp setPresentationOptions:presentationOpts];
+}
+
 @end
 
 /*****************************************************************************