feat: add BrowserWindow.isSnapped() (#46226)

* feat: add BrowserWindow.isSnapped() on Windows

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* docs: mark _Readonly_

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2025-03-25 08:16:13 -05:00 committed by GitHub
parent 6f3c9fcf99
commit 25e5055065
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 52 additions and 0 deletions

View file

@ -611,6 +611,10 @@ A `string` property that defines an alternative title provided only to
accessibility tools such as screen readers. This string is not directly
visible to users.
#### `win.snapped` _Windows_ _Readonly_
A `boolean` property that indicates whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
### Instance Methods
Objects created with `new BrowserWindow` have the following instance methods:
@ -1445,6 +1449,13 @@ Sets whether the menu bar should be visible. If the menu bar is auto-hide, users
Returns `boolean` - Whether the menu bar is visible.
#### `win.isSnapped()` _Windows_
Returns `boolean` - whether the window is arranged via [Snap.](https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241)
The window is snapped via buttons shown when the mouse is hovered over window
maximize button, or by dragging it to the edges of the screen.
#### `win.setVisibleOnAllWorkspaces(visible[, options])` _macOS_ _Linux_
* `visible` boolean