I'd like to keep track of which windows I've captured using ScreenCaptureKit (so users can quickly swap through their history) and I'm using the SCContentSharingPicker
.
From what I can tell there seems to be no way to get information about the window (the SCWindow
or equivalent) that's accessible via the filter passed to contentSharingPicker(_ picker: SCContentSharingPicker, didUpdateWith filter: SCContentFilter, for stream: SCStream?)
.
In the debugger I can see the the filter has a (I assume private) member called _individualwindow
which contains the SCWindow
but I couldn't find a way to access it.
info(for filter: SCContentFilter) -> SCShareableContentInfo
doesn't seem to return anything useful (only the size of the recorded content)
Any suggestions for how to access the SCWindow
? The only other idea I have is to use one of the getExcludingDesktopWindows
methods and try to match what's in the filter somehow?
Starting with macOS 15.2 the SCContentFilter provides the new properties includedDisplays
of type [SCDisplay]
and includedWindows
of type [SCWindow]
.
Otherwise, for older versions the only solution that I found was similar to yours: filter all of the available windows and check for one that matches the size and optionally the positioning of the filter (SCContentFilter.contentRect
, also available starting with macOS 14.0).