summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa/window.m
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/cocoa/window.m')
-rw-r--r--video/out/cocoa/window.m28
1 files changed, 20 insertions, 8 deletions
diff --git a/video/out/cocoa/window.m b/video/out/cocoa/window.m
index a661565c1d..770469bf38 100644
--- a/video/out/cocoa/window.m
+++ b/video/out/cocoa/window.m
@@ -97,18 +97,28 @@
[super toggleFullScreen:sender];
if (![self.adapter isInFullScreenMode]) {
- [self setStyleMask:([self styleMask] | NSWindowStyleMaskFullScreen)];
- NSRect frame = [[self targetScreen] frame];
- [self setFrame:frame display:YES];
+ [self setToFullScreen];
} else {
- [self setStyleMask:([self styleMask] & ~NSWindowStyleMaskFullScreen)];
- NSRect frame = [self calculateWindowPositionForScreen:[self targetScreen]];
- [self setFrame:frame display:YES];
- [self setContentAspectRatio:_unfs_content_frame.size];
- [self setCenteredContentSize:_unfs_content_frame.size];
+ [self setToWindow];
}
}
+- (void)setToFullScreen
+{
+ [self setStyleMask:([self styleMask] | NSWindowStyleMaskFullScreen)];
+ NSRect frame = [[self targetScreen] frame];
+ [self setFrame:frame display:YES];
+}
+
+- (void)setToWindow
+{
+ [self setStyleMask:([self styleMask] & ~NSWindowStyleMaskFullScreen)];
+ NSRect frame = [self calculateWindowPositionForScreen:[self targetScreen]];
+ [self setFrame:frame display:YES];
+ [self setContentAspectRatio:_unfs_content_frame.size];
+ [self setCenteredContentSize:_unfs_content_frame.size];
+}
+
- (NSArray *)customWindowsToEnterFullScreenForWindow:(NSWindow *)window
{
return [NSArray arrayWithObject:window];
@@ -139,11 +149,13 @@
- (void)windowDidFailToEnterFullScreen:(NSWindow *)window
{
_is_animating = 0;
+ [self setToWindow];
}
- (void)windowDidFailToExitFullScreen:(NSWindow *)window
{
_is_animating = 0;
+ [self setToFullScreen];
}
- (void)windowDidChangeBackingProperties:(NSNotification *)notification