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, 28 insertions, 0 deletions
diff --git a/video/out/cocoa/window.m b/video/out/cocoa/window.m
index 68e5222a03..2bc7a5865a 100644
--- a/video/out/cocoa/window.m
+++ b/video/out/cocoa/window.m
@@ -212,6 +212,34 @@
[self.adapter putCommand:cmd];
}
+- (void)updateBorder:(int)border
+{
+ int borderStyle = NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|
+ NSWindowStyleMaskMiniaturizable;
+ if (border) {
+ int window_mask = [self styleMask] & ~NSWindowStyleMaskBorderless;
+ window_mask |= borderStyle;
+ [self setStyleMask:window_mask];
+ } else {
+ int window_mask = [self styleMask] & ~borderStyle;
+ window_mask |= NSWindowStyleMaskBorderless;
+ [self setStyleMask:window_mask];
+ }
+
+ if (![self.adapter isInFullScreenMode]) {
+ // XXX: workaround to force redrawing of window decoration
+ if (border) {
+ NSRect frame = [self frame];
+ frame.size.width += 1;
+ [self setFrame:frame display:YES];
+ frame.size.width -= 1;
+ [self setFrame:frame display:YES];
+ }
+
+ [self setContentAspectRatio:_unfs_content_frame.size];
+ }
+}
+
- (NSRect)frameRect:(NSRect)f forCenteredContentSize:(NSSize)ns
{
NSRect cr = [self contentRectForFrameRect:f];