-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat: use CGPreflightScreenCaptureAccess API for ScreenAuthStatus #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thanks - this is great. Lint and test CI are failing right now because of missing LDFLAGS
- when we add CoreGraphics we also need to add that library to binding.gyp
.
Once that's fixed up we can get this landed!
Thank you, @codebytere. I don't know what happens but CI keeps returning |
@quanglam2807 i'll take a closer look soon 🤔 |
Any progress made on this? I'm curious if the CI is running a different version of xcode or using command line tools instead. Maybe the CI SDK version need to be synced with your dev environment @quanglam2807?
Ref: https://www.jessesquires.com/blog/2020/01/06/selecting-an-xcode-version-on-github-ci/ |
@quanglam2807 would you mind rebasing this? I can take it over and try @mmaietta's suggestion above if you'd like as well |
7633301
to
c4a2409
Compare
Thank you for checking this, @codebytere @mmaietta I managed to fix the problem partially by using newer SDK. But I don't know how to fix:
This is odd. If the API is supported in macOS 10.15+, then I suppose the symbol must be in the system's framework? |
@quanglam2807 looks like: lwouis/alt-tab-macos#704 (comment) |
It seems like the API is added in Bug Sur. So Apple provides wrong documentation? I can modify the PR to only use the new API in macOS 11+ and retain the old code for older versions. Would that work? |
@quanglam2807 sounds great to me! Thanks for being patient with this PR - appreciated 🙇🏻♀️ |
Based on this: https://stackoverflow.com/a/65423834/5522263, Apple has an official API to get Screen Auth permission status:
CGPreflightScreenCaptureAccess
: https://developer.apple.com/documentation/coregraphics/3656523-cgpreflightscreencaptureaccessI've tested this with Electron 11.1.1 + macOS 11 and it worked perfectly.