mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-31 09:01:04 +03:00
try to fix issue #3261 with new api, but not sure if it works
This commit is contained in:
@@ -4,6 +4,27 @@
|
||||
#include <Security/Authorization.h>
|
||||
#include <Security/AuthorizationTags.h>
|
||||
|
||||
extern "C" bool CanUseNewApiForScreenCaptureCheck() {
|
||||
#ifdef NO_InputMonitoringAuthStatus
|
||||
return false;
|
||||
#else
|
||||
NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
|
||||
return version.majorVersion >= 11;
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" bool IsCanScreenRecording(bool prompt) {
|
||||
#ifdef NO_InputMonitoringAuthStatus
|
||||
return false;
|
||||
#else
|
||||
bool res = CGPreflightScreenCaptureAccess();
|
||||
if (!res && prompt) {
|
||||
CGRequestScreenCaptureAccess();
|
||||
}
|
||||
return res;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// https://github.com/codebytere/node-mac-permissions/blob/main/permissions.mm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user