Update docs on win.setIgnoreMouseEvents

This commit is contained in:
Cheng Zhao 2016-06-07 20:32:52 +09:00
parent f8b69c1fac
commit 6192eef1b6
2 changed files with 22 additions and 6 deletions

View file

@ -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