diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-06-16 14:37:15 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-06-16 14:37:15 +0200 |
commit | 4589e4a723f1de20c8fe3f5c5113d5b04762027e (patch) | |
tree | 7b40e75b0d80ccf59fef81ad6d7339c401f29f3f /src/api | |
parent | eb73c2514eefae08a5f1850ce7ee7178b903c4cf (diff) | |
parent | bbaa129842d38d3182771da1d4baf399304a4f5f (diff) | |
download | glutin-4589e4a723f1de20c8fe3f5c5113d5b04762027e.tar.gz glutin-4589e4a723f1de20c8fe3f5c5113d5b04762027e.zip |
Merge pull request #487 from fkaa/cocoa-transparency
Add transparency support for cocoa.
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/cocoa/mod.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs index ba5710d..d080d06 100644 --- a/src/api/cocoa/mod.rs +++ b/src/api/cocoa/mod.rs @@ -357,6 +357,21 @@ impl Window { }; unsafe { + if builder.transparent { + let clear_col = { + let cls = Class::get("NSColor").unwrap(); + + msg_send![cls, clearColor] + }; + window.setOpaque_(NO); + window.setBackgroundColor_(clear_col); + + let obj = context.CGLContextObj(); + + let mut opacity = 0; + CGLSetParameter(obj, kCGLCPSurfaceOpacity, &mut opacity); + } + app.activateIgnoringOtherApps_(YES); if builder.visible { window.makeKeyAndOrderFront_(nil); @@ -437,7 +452,7 @@ impl Window { } }; - let masks = if screen.is_some() { + let masks = if screen.is_some() || !builder.decorations { NSBorderlessWindowMask as NSUInteger } else { NSTitledWindowMask as NSUInteger | |