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) {
(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,