[vlc-commits] macosx: deduplicate code for fullscreen presentation options
David Fuhrmann
git at videolan.org
Fri Feb 15 20:23:48 CET 2013
vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Fri Feb 15 18:52:59 2013 +0100| [138034aebfdcc30a2734bdd98a8e0a78f90a0c0c] | committer: David Fuhrmann
macosx: deduplicate code for fullscreen presentation options
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=138034aebfdcc30a2734bdd98a8e0a78f90a0c0c
---
modules/gui/macosx/VLCVoutWindowController.m | 1 -
modules/gui/macosx/Windows.m | 14 ++------------
modules/gui/macosx/misc.m | 17 +++++++++++------
3 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index c5005d4..713b309 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -305,5 +305,4 @@
@synthesize currentWindowLevel=i_currentWindowLevel;
-
@end
diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index dfbeb81..2b39924 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -786,12 +786,7 @@
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]];
@@ -841,12 +836,7 @@
[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];
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 01c8e5e..4d07d8e 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -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
/*****************************************************************************
More information about the vlc-commits
mailing list