Browse Source

Update docs on win.setIgnoreMouseEvents

Cheng Zhao 9 years ago
parent
commit
6192eef1b6
2 changed files with 22 additions and 6 deletions
  1. 6 2
      docs/api/browser-window.md
  2. 16 4
      docs/api/frameless-window.md

+ 6 - 2
docs/api/browser-window.md

@@ -928,10 +928,14 @@ Returns whether the window is visible on all workspaces.
 
 **Note:** This API always returns false on Windows.
 
-### `win.setIgnoreMouseEvents(ignore)` _OS X_
+### `win.setIgnoreMouseEvents(ignore)`
 
 * `ignore` Boolean
 
-Ignore all moused events that happened in the window.
+Makes the window ignore all mouse events.
+
+All mouse events happened in this window will be passed to the window bellow
+this window, but if this window has focus, it will still receive keyboard
+events.
 
 [blink-feature-string]: https://code.google.com/p/chromium/codesearch#chromium/src/out/Debug/gen/blink/platform/RuntimeEnabledFeatures.cpp&sq=package:chromium&type=cs&l=576

+ 16 - 4
docs/api/frameless-window.md

@@ -14,8 +14,8 @@ To create a frameless window, you need to set `frame` to `false` in
 
 
 ```javascript
-const {BrowserWindow} = require('electron');
-let win = new BrowserWindow({width: 800, height: 600, frame: false});
+const {BrowserWindow} = require('electron')
+let win = new BrowserWindow({width: 800, height: 600, frame: false})
 ```
 
 ### Alternatives on OS X
@@ -28,7 +28,7 @@ the window controls ("traffic lights") for standard window actions.
 You can do so by specifying the new `titleBarStyle` option:
 
 ```javascript
-let win = new BrowserWindow({titleBarStyle: 'hidden'});
+let win = new BrowserWindow({titleBarStyle: 'hidden'})
 ```
 
 ## Transparent window
@@ -37,7 +37,7 @@ By setting the `transparent` option to `true`, you can also make the frameless
 window transparent:
 
 ```javascript
-let win = new BrowserWindow({transparent: true, frame: false});
+let win = new BrowserWindow({transparent: true, frame: false})
 ```
 
 ### Limitations
@@ -59,6 +59,16 @@ let win = new BrowserWindow({transparent: true, frame: false});
   Linux.
 * On Mac the native window shadow will not be shown on a transparent window.
 
+## Click-through window
+
+To create a click-through window, i.e. making the window ignore all mouse
+events, you can call the [win.setIgnoreMouseEvents(ignore)][ignore-mouse-events]
+API:
+
+```javascript
+win.setIgnoreMouseEvents(true)
+```
+
 ## Draggable region
 
 By default, the frameless window is non-draggable. Apps need to specify
@@ -108,3 +118,5 @@ On some platforms, the draggable area will be treated as a non-client frame, so
 when you right click on it a system menu will pop up. To make the context menu
 behave correctly on all platforms you should never use a custom context menu on
 draggable areas.
+
+[ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore