Merge pull request #673 from ahihi/master

Fix fullscreen on OS X
This commit is contained in:
tomaka 2015-12-20 07:55:26 +01:00
commit 87f0edea7b

View file

@ -396,26 +396,24 @@ impl Window {
} }
}; };
let masks = match (attrs.decorations, attrs.transparent) { let masks = if screen.is_some() || attrs.transparent {
(true, false) => // Fullscreen or transparent window
// Classic opaque window with titlebar NSBorderlessWindowMask as NSUInteger
NSClosableWindowMask as NSUInteger | } else if attrs.decorations {
NSMiniaturizableWindowMask as NSUInteger | // Classic opaque window with titlebar
NSResizableWindowMask as NSUInteger | NSClosableWindowMask as NSUInteger |
NSTitledWindowMask as NSUInteger, NSMiniaturizableWindowMask as NSUInteger |
(false, false) => NSResizableWindowMask as NSUInteger |
// Opaque window without a titlebar NSTitledWindowMask as NSUInteger
NSClosableWindowMask as NSUInteger | } else {
NSMiniaturizableWindowMask as NSUInteger | // Opaque window without a titlebar
NSResizableWindowMask as NSUInteger | NSClosableWindowMask as NSUInteger |
NSTitledWindowMask as NSUInteger | NSMiniaturizableWindowMask as NSUInteger |
NSFullSizeContentViewWindowMask as NSUInteger, NSResizableWindowMask as NSUInteger |
(_, true) => NSTitledWindowMask as NSUInteger |
// Fully transparent window. NSFullSizeContentViewWindowMask as NSUInteger
// No shadow, decorations or borders.
NSBorderlessWindowMask as NSUInteger
}; };
let window = IdRef::new(NSWindow::alloc(nil).initWithContentRect_styleMask_backing_defer_( let window = IdRef::new(NSWindow::alloc(nil).initWithContentRect_styleMask_backing_defer_(
frame, frame,
masks, masks,