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

macosx: deduplicate code for fullscreen presentation options

parent 6c1ae0ff
......@@ -305,5 +305,4 @@
@synthesize currentWindowLevel=i_currentWindowLevel;
@end
......@@ -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];
......
......@@ -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
/*****************************************************************************
......
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