From e3cb389c6a08f4aecac6f93ed3ecd56327149c8b Mon Sep 17 00:00:00 2001 From: Miranda Kastemaa Date: Fri, 11 Dec 2015 23:23:23 +0200 Subject: [PATCH] Fix fullscreen on OS X --- src/api/cocoa/mod.rs | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs index b7e0239e..c9e35a84 100644 --- a/src/api/cocoa/mod.rs +++ b/src/api/cocoa/mod.rs @@ -396,26 +396,24 @@ impl Window { } }; - let masks = match (attrs.decorations, attrs.transparent) { - (true, false) => - // Classic opaque window with titlebar - NSClosableWindowMask as NSUInteger | - NSMiniaturizableWindowMask as NSUInteger | - NSResizableWindowMask as NSUInteger | - NSTitledWindowMask as NSUInteger, - (false, false) => - // Opaque window without a titlebar - NSClosableWindowMask as NSUInteger | - NSMiniaturizableWindowMask as NSUInteger | - NSResizableWindowMask as NSUInteger | - NSTitledWindowMask as NSUInteger | - NSFullSizeContentViewWindowMask as NSUInteger, - (_, true) => - // Fully transparent window. - // No shadow, decorations or borders. - NSBorderlessWindowMask as NSUInteger + let masks = if screen.is_some() || attrs.transparent { + // Fullscreen or transparent window + NSBorderlessWindowMask as NSUInteger + } else if attrs.decorations { + // Classic opaque window with titlebar + NSClosableWindowMask as NSUInteger | + NSMiniaturizableWindowMask as NSUInteger | + NSResizableWindowMask as NSUInteger | + NSTitledWindowMask as NSUInteger + } else { + // Opaque window without a titlebar + NSClosableWindowMask as NSUInteger | + NSMiniaturizableWindowMask as NSUInteger | + NSResizableWindowMask as NSUInteger | + NSTitledWindowMask as NSUInteger | + NSFullSizeContentViewWindowMask as NSUInteger }; - + let window = IdRef::new(NSWindow::alloc(nil).initWithContentRect_styleMask_backing_defer_( frame, masks,