I have a custom NSWindow that I want to exclude from screen capture by setting its sharing state to kCGWindowSharingStateSharingNone. The goal is to prevent this window from appearing in the content captured by ScreenCaptureKit.
[window setSharingType:NSWindowSharingType::NSWindowSharingNone];
However, on macOS 15.4+ (Sequoia), the window is still captured by ScreenCaptureKit and appears in the shared content.
Does anyone know if kCGWindowSharingStateSharingNone is still effective with ScreenCaptureKit on macOS 15.4 and later?
At this time there are no public APIs for preventing screen capture.
If you'd like us to consider adding APIs for that, please file an enhancement request using the Feedback Assistant. If you file the request, please post the Feedback number here so we can make sure it gets routed to the right team.
If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?