aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/api/cocoa/mod.rs17
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 |