feat: allow setting window shape (backport: 3-0-x) (#14445)
* feat: allow setting window shape This binds Widget::SetShape, an API that already exists in Chromium (for Windows and Linux). It's a more reliable method of having some parts of your window be "click-through" than the current `setIgnoreMouseEvents` API, which messes around with the `WS_EX_LAYERED` window style on Windows, causing strange bugs and incompatibility with hardware acceleration. * update docs
This commit is contained in:
parent
12087b74e8
commit
ce592a5705
4 changed files with 28 additions and 0 deletions
|
@ -1264,6 +1264,17 @@ Sets the opacity of the window. On Linux does nothing.
|
|||
|
||||
Returns `Number` - between 0.0 (fully transparent) and 1.0 (fully opaque)
|
||||
|
||||
#### `win.setShape(rects)` _Windows_ _Linux_ _Experimental_
|
||||
|
||||
* `rects` [Rectangle[]](structures/rectangle.md) - Sets a shape on the window.
|
||||
Passing an empty list reverts the window to being rectangular.
|
||||
|
||||
Setting a window shape determines the area within the window where the system
|
||||
permits drawing and user interaction. Outside of the given region, no pixels
|
||||
will be drawn and no mouse events will be registered. Mouse events outside of
|
||||
the region will not be received by that window, but will fall through to
|
||||
whatever is behind the window.
|
||||
|
||||
#### `win.setThumbarButtons(buttons)` _Windows_
|
||||
|
||||
* `buttons` [ThumbarButton[]](structures/thumbar-button.md)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue