]> git.sesse.net Git - vlc/commitdiff
macosx: deduplicate code for fullscreen presentation options
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Fri, 15 Feb 2013 17:52:59 +0000 (18:52 +0100)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Fri, 15 Feb 2013 19:22:38 +0000 (20:22 +0100)
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/Windows.m
modules/gui/macosx/misc.m

index c5005d469c68814063df44c36f6e50108d4011f5..713b30924654fbe7feefe80be2d6710dcc3897ae 100644 (file)
 
 @synthesize currentWindowLevel=i_currentWindowLevel;
 
-
 @end
index dfbeb819af7c012b11d4775128657f80dc30f0ac..2b399245b1ab446bcfb044abf802a0878d2f73d2 100644 (file)
                 CGDisplayFade(token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES);
             }
 
-            NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions];
-            if ([screen hasMenuBar])
-                presentationOpts |= NSApplicationPresentationAutoHideMenuBar;
-            if ([screen hasMenuBar] || [screen hasDock])
-                presentationOpts |= NSApplicationPresentationAutoHideDock;
-            [NSApp setPresentationOptions:presentationOpts];
+            [screen setFullscreenPresentationOptions];
 
             [[o_video_view superview] replaceSubview:o_video_view with:o_temp_view];
             [o_temp_view setFrame:[o_video_view frame]];
         [o_fullscreen_anim2 release];
     }
 
-    NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions];
-    if ([screen hasMenuBar])
-        presentationOpts |= NSApplicationPresentationAutoHideMenuBar;
-    if ([screen hasMenuBar] || [screen hasDock])
-        presentationOpts |= NSApplicationPresentationAutoHideDock;
-    [NSApp setPresentationOptions:presentationOpts];
+    [screen setFullscreenPresentationOptions];
 
     dict1 = [[NSMutableDictionary alloc] initWithCapacity:2];
     dict2 = [[NSMutableDictionary alloc] initWithCapacity:3];
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
 
 /*****************************************************************************