feat: add BrowserWindow.isTabletMode API (#25209)

This commit is contained in:
Cheng Zhao 2020-09-22 14:40:42 +09:00 committed by GitHub
parent 2dd7ad268b
commit c50ded2b71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 0 deletions

View file

@ -1346,6 +1346,17 @@ Enters or leaves kiosk mode.
Returns `Boolean` - Whether the window is in kiosk mode.
#### `win.isTabletMode()` _Windows_
Returns `Boolean` - Whether the window is in Windows 10 tablet mode.
Since Windows 10 users can [use their PC as tablet](https://support.microsoft.com/en-us/help/17210/windows-10-use-your-pc-like-a-tablet),
under this mode apps can choose to optimize their UI for tablets, such as
enlarging the titlebar and hiding titlebar buttons.
This API returns whether the window is in tablet mode, and the `resize` event
can be be used to listen to changes to tablet mode.
#### `win.getMediaSourceId()`
Returns `String` - Window id in the format of DesktopCapturerSource's id. For example "window:1234:0".