Skip to content

fix(macos): keep the privacy indicator out of ScreenCaptureKit capture - #6160

Open
dave-atx wants to merge 1 commit into
SunshineStream:masterfrom
dave-atx:fix/macos-exclude-privacy-indicator
Open

dave-atx wants to merge 1 commit into
SunshineStream:masterfrom
dave-atx:fix/macos-exclude-privacy-indicator

Conversation

@dave-atx

Copy link
Copy Markdown

Description

While Sunshine captures, macOS shows its purple recording indicator in the top-right corner of every display, and ScreenCaptureKit captures it along with everything else (sc_capture.mm#L258 excludes no windows). On a dedicated or virtual display used for streaming, the dot sits on top of the game for the whole session.

The indicator is a WindowServer window titled StatusIndicator with no owning bundle, and SCShareableContent lists it. This excludes those windows from the content filter: once from fresh content when the stream starts, and again two seconds later through updateContentFilter, because starting the capture is what creates the indicator. Nothing changes on the Mac's own screens; the indicator still shows there.

Screenshot

N/A

Issues Fixed or Closed

Roadmap Issues

Testing

  • New SCCaptureLoop.PrivacyIndicatorWindowIsRecognized for the window match (title plus no bundle, so an app window with that title is still captured).
  • Built test_sunshine on macOS 27.2.1 / M3 Pro with -DBUILD_WERROR=ON: 812 passed, 9 skipped, excluding *AudioTest*, which waits on a microphone permission prompt for the test binary here and hangs (unrelated).
  • Manual: two streams to an Apple TV (Moonlight) from a non-main CGVirtualDisplay; the dot was visible in the stream before the change and not after.
  • The match depends on macOS's window title, which Apple could change; if it does, the dot just comes back.

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Tests have been added or updated for new or modified functionality, including regression tests for bug fixes

AI Usage

See our AI usage policy.

  • AI tools were used while preparing this PR

While a recording runs, macOS draws a purple dot in the top-right corner of every display. It is a WindowServer window titled StatusIndicator, and SCContentFilter captured it like any other window, so it showed in the stream. Exclude it when the stream starts and again two seconds later via updateContentFilter, since starting the capture is what creates it.
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant