]> khamidou — GitHub mirrors - electron.git/commitdiff
mac: Use transparent window
authorCheng Zhao <zcbenz@gmail.com>
Tue, 23 Dec 2014 19:17:56 +0000 (11:17 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 23 Dec 2014 19:17:56 +0000 (11:17 -0800)
atom/browser/native_window_mac.mm

index c57ceee97fb39ba1b519d92bb6ad86a22e37eb99..304e1f7f4c282ba2521ad5c58f90f68e77c1d310 100644 (file)
@@ -314,6 +314,13 @@ NativeWindowMac::NativeWindowMac(content::WebContents* web_contents,
       [[AtomNSWindowDelegate alloc] initWithShell:this];
   [window_ setDelegate:delegate];
 
+  if (transparent_) {
+    // Make window has transparent background.
+    [window_ setOpaque:NO];
+    [window_ setHasShadow:NO];
+    [window_ setBackgroundColor:[NSColor clearColor]];
+  }
+
   // We will manage window's lifetime ourselves.
   [window_ setReleasedWhenClosed:NO];