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

CGWindowList future deprecation #1945

Closed
brettstover opened this issue Sep 13, 2022 · 1 comment
Closed

CGWindowList future deprecation #1945

brettstover opened this issue Sep 13, 2022 · 1 comment

Comments

@brettstover
Copy link

At the end of "Meet ScreenCaptureKit" from WWDC 2022 [https://developer.apple.com/videos/play/wwdc2022/10156/], it's mentioned that CGWindowList will be deprecated in the future. Just wanted to post this here as a heads up and something to start thinking about.

From my own investigation, the ScreenCaptureKit API for getting window information is quite limited (and requires screen recording permission just to get the window list without actually recording anything from the screen). This will (among other things) break the check for if user is in mission control or not. Any thoughts generally about the impact of this future deprecation, workarounds, alternatives, etc? Is there other private API that can be used in place of CGWindowList (assuming that after deprecation it is gone entirely and not available as private API). Are there any alternate methods available for checking mission control status?

@brettstover brettstover changed the title CGWindowList deprecation CGWindowList future deprecation Sep 13, 2022
@lwouis
Copy link
Owner

lwouis commented Sep 13, 2022

Hi @brettstover,

Thank you for sharing this.

You can see ScreenCaptureKit, as well as the myriad of other APIs and tricks being discussed here: #447. The ticket is quite rich, so maybe start there: #447 (comment). Another interesting angle: #122.

Finally I'll note that an API being deprecated means nothing. AltTab makes use of Carbon APIs that have been deprecated for like 10 years, and which documentation is no longer even on Apple Website. The old APIs are very useful and very used, thus breaking them breaks apps people use. So Apple has very little incentive to break things. They may do it, but historically they haven't much. Here in concrete terms, removing this API would break all sorts of popular screen readers and other accessibility software. For what benefits? The new API is not safer or anything; the permissions work the same as the current API. So I'm not holding my breath.

The real issue is the private API CGSAddWindowsToSpaces being removed recently. That one, we have 0 replacement for, and it breaks AltTab's behavior on newer macOS releases.

@lwouis lwouis closed this as completed Sep 13, 2022
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

No branches or pull requests

2 participants