-
-
Notifications
You must be signed in to change notification settings - Fork 330
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
Fix permissions for macos 15 #3497
base: master
Are you sure you want to change the base?
Conversation
Fixes issue #3477 |
src/logic/SystemPermissions.swift
Outdated
} | ||
return true | ||
} | ||
|
||
// workaround: public API CGPreflightScreenCaptureAccess and private API SLSRequestScreenCaptureAccess exist, but |
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.
Have you seen this? We were not using this API because it wasn't the best in the past.
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.
Yes, I read it, I will make it that it uses it for MacOS 15+, I tested it yesterday and it works like a charm
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.
AltTab checks permissions continuously. The user could remove permissions at any point. We check for that on a repeating timer.
As the comment says, CGPreflightScreenCaptureAccess
was returning a value which was not updated. It was a snapshot of the permissions at the time the app was launched, but didn't update after that initial snapshot.
Has this behavior changed in macOS 15? If it hasn't, then we should change other parts of the app doing the repeating timer checks. Either find another way to check there, or remove the check. But if we remove the check, we need another way to notice when the screenshot()
and the AX calls start failing.
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.
I changed it to the canRecordScreen, this is updated during runtime
- Simplify `screenRecordingIsGranted_()` method by removing unnecessary `CGDisplayStream` check - Remove `canRecordScreen()` method as it is no longer needed - Update `screenRecordingIsGranted()` method to use the simplified `screenRecordingIsGranted_()` implementation
- Simplify `accessibilityIsGranted()` and `screenRecordingIsGranted()` methods - Refactor `observePermissionsPostStartup()` and `observePermissionsPreStartup()` methods to improve reliability of permission checks - Ensure permissions are granted before continuing app startup
Now I only altered the I think this is a stable solution |
@DominicVonk Using Here's an interesting thread to read. The whole ticket is about issues with falsely detecting that the permission is gone, when it is in fact not gone. The current implementation is solid. It has passed the test of time. It's now being challenged by changes in the latest macOS. Here are some thoughts to go forwards:
|
7d7d9cf
to
8abb9b4
Compare
Thank you for opening a PR! Please make sure that: