]> khamidou — GitHub mirrors - electron.git/commitdiff
docs: Transparent window
authorCheng Zhao <zcbenz@gmail.com>
Mon, 12 Jan 2015 23:27:33 +0000 (15:27 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 12 Jan 2015 23:27:33 +0000 (15:27 -0800)
docs/api/browser-window.md
docs/api/frameless-window.md

index 137e8e5b92e162d2a965c070db322a5f2540bf0e..66be9ccaef86272479fc2e9058d2dac8da63c3de 100644 (file)
@@ -66,6 +66,7 @@ You can also create a window without chrome by using
     scripts run in the window. This script will always have access to node APIs
     no matter whether node integration is turned on for the window, and the path
     of `preload` script has to be absolute path.
+  * `transparent` Boolean - Makes the window [transparent](frameless-window.md)
   * `web-preferences` Object - Settings of web page's features
     * `javascript` Boolean
     * `web-security` Boolean
index b7ff5ca43054acdf57c378271c2b9a588882da53..f6a8923e35d67e4dda2eef3e67437ecda1fe78cd 100644 (file)
@@ -13,6 +13,31 @@ var BrowserWindow = require('browser-window');
 var win = new BrowserWindow({ width: 800, height: 600, frame: false });
 ```
 
+## Transparent window
+
+By setting the `transparent` option to `true`, you can also make the frameless
+window transparent:
+
+```javascript
+var win = new BrowserWindow({ transparent: true, frame: false });
+```
+
+### Limitations
+
+* You can not click through the transparent area, we are going to introduce an
+  API to set window shape to solve this, but currently blocked at an
+  [upstream bug](https://code.google.com/p/chromium/issues/detail?id=387234).
+* Transparent window is not resizable, setting `resizable` to `true` may make
+  transprent window stop working on some platforms.
+* The `blur` filter only applies to the web page, so there is no way to apply
+  blur effect to the content bellow the window.
+* On Windows transparent window will not work when DWM is disabled.
+* On Linux users have to put `--enable-transparent-visuals --disable-gpu` in
+  command line to disable GPU and allow ARGB to make transparent window, this is
+  caused by an upstream bug that [alpha channel doesn't work on some NVidia
+  drivers](https://code.google.com/p/chromium/issues/detail?id=369209) on Linux.
+* On Mac the native window shadow will not show for transparent window.
+
 ## Draggable region
 
 By default, the frameless window is non-draggable. Apps need to specify