mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -4784,6 +4784,24 @@ describe('BrowserWindow module', () => {
|
||||
});
|
||||
});
|
||||
|
||||
ifdescribe(process.platform === 'darwin')('isHiddenInMissionControl state', () => {
|
||||
it('with functions', () => {
|
||||
it('can be set with ignoreMissionControl constructor option', () => {
|
||||
const w = new BrowserWindow({ show: false, hiddenInMissionControl: true });
|
||||
expect(w.isHiddenInMissionControl()).to.be.true('isHiddenInMissionControl');
|
||||
});
|
||||
|
||||
it('can be changed', () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
expect(w.isHiddenInMissionControl()).to.be.false('isHiddenInMissionControl');
|
||||
w.setHiddenInMissionControl(true);
|
||||
expect(w.isHiddenInMissionControl()).to.be.true('isHiddenInMissionControl');
|
||||
w.setHiddenInMissionControl(false);
|
||||
expect(w.isHiddenInMissionControl()).to.be.false('isHiddenInMissionControl');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// fullscreen events are dispatched eagerly and twiddling things too fast can confuse poor Electron
|
||||
|
||||
ifdescribe(process.platform === 'darwin')('kiosk state', () => {
|
||||
|
||||
Reference in New Issue
Block a user