feat: Add BrowserWindow option to hide window in Mission Control (macOS) (#36092)

* feat: Add BrowserWindow option to ignore Mission Control (macOS)
* There are many circumstances when app developers may want to hide their
windows from mission control. E.g., full screen overlays, small helper
windows, dialogs, etc.
* This PR adds the functionality, docs, and tests.

* chore:Rename variables

* Update shell/browser/native_window_mac.h

Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>

Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
Brad Carter 2022-11-01 16:43:42 -04:00 committed by GitHub
parent 8b430c9d26
commit 15540975ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 77 additions and 1 deletions

View file

@ -192,6 +192,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
macOS. Default is `false`.
* `skipTaskbar` boolean (optional) _macOS_ _Windows_ - Whether to show the window in taskbar.
Default is `false`.
* `hiddenInMissionControl` boolean (optional) _macOS_ - Whether window should be hidden when the user toggles into mission control.
* `kiosk` boolean (optional) - Whether the window is in kiosk mode. Default is `false`.
* `title` string (optional) - Default window title. Default is `"Electron"`. If the HTML tag `<title>` is defined in the HTML file loaded by `loadURL()`, this property will be ignored.
* `icon` ([NativeImage](native-image.md) | string) (optional) - The window icon. On Windows it is
@ -1255,6 +1256,16 @@ Returns `boolean` - Whether the window can be manually closed by user.
On Linux always returns `true`.
#### `win.setHiddenInMissionControl(hidden)` _macOS_
* `hidden` boolean
Sets whether the window will be hidden when the user toggles into mission control.
#### `win.isHiddenInMissionControl()` _macOS_
Returns `boolean` - Whether the window will be hidden when the user toggles into mission control.
#### `win.setAlwaysOnTop(flag[, level][, relativeLevel])`
* `flag` boolean