-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Replace legacy code on macOS builds #11428
base: develop
Are you sure you want to change the base?
Conversation
Omg thank you, I really didn't want to figure this one out. |
|
||
// Attempt to use SCShareableContent to check for screen recording permission | ||
[SCShareableContent getShareableContentWithCompletionHandler:^(SCShareableContent * _Nullable content, | ||
NSError * _Nullable error) { |
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.
You must use Q_UNUSED(error)
for the second parameter. Otherwise the code will not compile.
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.
It's compilable; otherwise, I wouldn't be able to test if the screen recording permission request dialog works properly. Additionally, the automated tests didn't report any errors. However, if you believe that adding Q_UNUSED(error) can improve the code's robustness, then it can certainly be included.
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.
Q_UNUSED is only useful on Linux where GCC and Clang complain of unused parameters.
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 tested this with both macOS Sequoia and Sonoma. Disabled the setting in the System Preferences and then I didn't have a permission to perform Global Auto-Type.
Only complained about Q_UNUSED()
because the compiler gives me an error, not a warning.
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.
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.
If just disabling the setting does not work properly then there must be something missing?
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.
it's Macos problem, I have same story of some screenshot apps, I think it's about signature of software maybe....
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 just tested it, for the current official release 2.7.9, the behavior is the same, just disabling the setting does not work.
After adding Q_UNUSED(error), the automated tests do not pass. You may check the reason. |
The failures are ephermal and unrelated |
fix #11288, The CGDisplayStreamCreate function has been deprecated and the current code fails to compile on macOS 15 and above. Following Apple's official recommendations, this fix replaces CGDisplayStreamCreate with ScreenCaptureKit (MacOS 12.3+). Since ScreenCaptureKit is an asynchronous framework, necessary semaphore waiting has been added to the code. This change successfully triggers the screen recording permission request dialog and allows proper use of autotype when permission is granted. The code has been tested and confirmed working on macOS 15.0.1.
Type of change