Commit 138034ae authored by David Fuhrmann's avatar David Fuhrmann

macosx: deduplicate code for fullscreen presentation options

parent 6c1ae0ff
...@@ -305,5 +305,4 @@ ...@@ -305,5 +305,4 @@
@synthesize currentWindowLevel=i_currentWindowLevel; @synthesize currentWindowLevel=i_currentWindowLevel;
@end @end
...@@ -786,12 +786,7 @@ ...@@ -786,12 +786,7 @@
CGDisplayFade(token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES); CGDisplayFade(token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES);
} }
NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions]; [screen setFullscreenPresentationOptions];
if ([screen hasMenuBar])
presentationOpts |= NSApplicationPresentationAutoHideMenuBar;
if ([screen hasMenuBar] || [screen hasDock])
presentationOpts |= NSApplicationPresentationAutoHideDock;
[NSApp setPresentationOptions:presentationOpts];
[[o_video_view superview] replaceSubview:o_video_view with:o_temp_view]; [[o_video_view superview] replaceSubview:o_video_view with:o_temp_view];
[o_temp_view setFrame:[o_video_view frame]]; [o_temp_view setFrame:[o_video_view frame]];
...@@ -841,12 +836,7 @@ ...@@ -841,12 +836,7 @@
[o_fullscreen_anim2 release]; [o_fullscreen_anim2 release];
} }
NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions]; [screen setFullscreenPresentationOptions];
if ([screen hasMenuBar])
presentationOpts |= NSApplicationPresentationAutoHideMenuBar;
if ([screen hasMenuBar] || [screen hasDock])
presentationOpts |= NSApplicationPresentationAutoHideDock;
[NSApp setPresentationOptions:presentationOpts];
dict1 = [[NSMutableDictionary alloc] initWithCapacity:2]; dict1 = [[NSMutableDictionary alloc] initWithCapacity:2];
dict2 = [[NSMutableDictionary alloc] initWithCapacity:3]; dict2 = [[NSMutableDictionary alloc] initWithCapacity:3];
......
...@@ -246,12 +246,7 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -246,12 +246,7 @@ static NSMutableArray *blackoutWindows = NULL;
[blackoutWindows addObject: blackoutWindow]; [blackoutWindows addObject: blackoutWindow];
[blackoutWindow release]; [blackoutWindow release];
NSApplicationPresentationOptions presentationOpts = [NSApp presentationOptions]; [screen setFullscreenPresentationOptions];
if ([screen hasMenuBar])
presentationOpts |= NSApplicationPresentationAutoHideMenuBar;
if ([screen hasMenuBar] || [screen hasDock])
presentationOpts |= NSApplicationPresentationAutoHideDock;
[NSApp setPresentationOptions:presentationOpts];
} }
} }
...@@ -267,6 +262,16 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -267,6 +262,16 @@ static NSMutableArray *blackoutWindows = NULL;
[NSApp setPresentationOptions:(NSApplicationPresentationDefault)]; [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 @end
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment