aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/cocoa/mod.rs
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-12-20 07:55:26 +0100
committertomaka <pierre.krieger1708@gmail.com>2015-12-20 07:55:26 +0100
commit87f0edea7ba872720152b5da296f0bd052d4c954 (patch)
tree6e3211b6cbf49973431bb113e21ccebafc7bd624 /src/api/cocoa/mod.rs
parent20a6e1ea6e6b08c2ed356eb21dd777016726a82b (diff)
parente3cb389c6a08f4aecac6f93ed3ecd56327149c8b (diff)
downloadglutin-87f0edea7ba872720152b5da296f0bd052d4c954.tar.gz
glutin-87f0edea7ba872720152b5da296f0bd052d4c954.zip
Merge pull request #673 from ahihi/master
Fix fullscreen on OS X
Diffstat (limited to 'src/api/cocoa/mod.rs')
-rw-r--r--src/api/cocoa/mod.rs36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs
index b7e0239..c9e35a8 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,