macOS needs a public API to detect if the screen is being observed (recorded, shared, or mirrored). iOS already offers this with UIScreen.isCaptured. macOS should have a similar capability to ensure consistency across platforms and improve user privacy.
I assume system notifications already use an internal API for this as they have a checkbox called "Allow notifications when mirroring or sharing the display".
Use Cases:
Sensitive Content Protection: Apps handling confidential or sensitive information can hide or blur content when the screen is being captured, preventing unintended exposure. For example, a calendar app could have a setting to hide event titles when the screen is captured, to avoid leaking private details on a screencast.
Fullscreen Notifications: Apps that show fullscreen alerts can suppress them when the screen is recorded or mirrored, ensuring privacy during sensitive operations.
Proposed API:
extension NSScreen {
var isCaptured: Bool {}
}
I looked through the private headers on macOS and found that there already is a private property for this called CGSIsScreenWatcherPresent. So the functionality seems to already exist and just needs to be exposed.
Description
macOS needs a public API to detect if the screen is being observed (recorded, shared, or mirrored). iOS already offers this with
UIScreen.isCaptured
. macOS should have a similar capability to ensure consistency across platforms and improve user privacy.I assume system notifications already use an internal API for this as they have a checkbox called "Allow notifications when mirroring or sharing the display".
Use Cases:
Proposed API:
I looked through the private headers on macOS and found that there already is a private property for this called
CGSIsScreenWatcherPresent
. So the functionality seems to already exist and just needs to be exposed.