Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Nov 1, 2022

Conversation

carterbs
Copy link
Contributor

@carterbs carterbs commented Oct 20, 2022

  • 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.

Description of Change

  • Adds hiddenInMissionControl constructor option
  • Adds isHiddenInMissionControl bw method.
  • Adds setHiddenInMissionControl bw method.

Checklist

Release Notes

Notes:

  • Adds new setHiddenInMissionControl API to allow developers to opt out of mission control on macOS.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Oct 20, 2022
@jkleinsc jkleinsc added the semver/minor backwards-compatible functionality label Oct 20, 2022
Copy link
Member

@nornagon nornagon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love that there are two names for this boolean, "ignoreMissionControl" and "ignoredByMissionControl". Can we settle on one or the other?

docs/api/browser-window.md Outdated Show resolved Hide resolved
docs/api/browser-window.md Outdated Show resolved Hide resolved
@carterbs
Copy link
Contributor Author

carterbs commented Oct 24, 2022

I don't love that there are two names for this boolean, "ignoreMissionControl" and "ignoredByMissionControl". Can we settle on one or the other?

The goal was to differentiate the boolean set at construction and the value at runtime.

"Should this window ignore mission control?"
"Is this window ignored by mission control?"

But I hear what you're saying. I'll swap it all for isIgnored as I think it's cleaner, even if it's more verbose.

Copy link
Member

@samuelmaddock samuelmaddock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe hiddenInMissionControl would be more easily understood? It also closer aligns with how Apple's docs describe the behavior.

The window floats in Spaces and hides in Mission Control.

https://developer.apple.com/documentation/appkit/nswindowcollectionbehavior/nswindowcollectionbehaviortransient

@carterbs
Copy link
Contributor Author

carterbs commented Oct 25, 2022 via email

@carterbs carterbs force-pushed the bradcarter/ignore-mission-control branch from 7cf290f to 05f63c9 Compare October 25, 2022 19:24
* 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.
@carterbs carterbs force-pushed the bradcarter/ignore-mission-control branch from 05f63c9 to ebbcc4e Compare October 25, 2022 19:28
@carterbs carterbs force-pushed the bradcarter/ignore-mission-control branch from ebbcc4e to 3c3fec8 Compare October 25, 2022 20:32
@carterbs carterbs changed the title feat: Add BrowserWindow option to ignore Mission Control (macOS) feat: Add BrowserWindow option to hide window in Mission Control (macOS) Oct 25, 2022
Copy link
Member

@samuelmaddock samuelmaddock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

shell/browser/native_window_mac.h Outdated Show resolved Hide resolved
Copy link
Member

@nornagon nornagon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@jkleinsc jkleinsc merged commit 1554097 into electron:main Nov 1, 2022
@release-clerk
Copy link

release-clerk bot commented Nov 1, 2022

Release Notes Persisted

  • Adds new setHiddenInMissionControl API to allow developers to opt out of mission control on macOS.

@VerteDinde
Copy link
Member

/trop run backport-to 22-x-y

@trop
Copy link
Contributor

trop bot commented Nov 18, 2022

The backport process for this PR has been manually initiated - sending your PR to 22-x-y!

@electron electron deleted a comment from trop bot Nov 18, 2022
@electron electron deleted a comment from trop bot Nov 18, 2022
@trop
Copy link
Contributor

trop bot commented Nov 18, 2022

I have automatically backported this PR to "22-x-y", please check out #36390

trop bot added a commit that referenced this pull request Nov 18, 2022
…OS) (#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>

Co-authored-by: Brad Carter <16466430+carterbs@users.noreply.github.com>
jkleinsc pushed a commit that referenced this pull request Jan 25, 2023
…OS) (#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>

Co-authored-by: Brad Carter <16466430+carterbs@users.noreply.github.com>
@trop trop bot added merged/22-x-y PR was merged to the "22-x-y" branch. and removed in-flight/22-x-y labels Jan 26, 2023
@miniak
Copy link
Contributor

miniak commented Feb 2, 2023

/trop run backport-to 23-x-y

@trop
Copy link
Contributor

trop bot commented Feb 2, 2023

The backport process for this PR has been manually initiated - sending your PR to 23-x-y!

@trop
Copy link
Contributor

trop bot commented Feb 2, 2023

I was unable to backport this PR to "23-x-y" cleanly;
you will need to perform this backport manually.

khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
…OS) (electron#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review/requested 🗳 merged/22-x-y PR was merged to the "22-x-y" branch. no-backport semver/minor backwards-compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants