fix: don't register some shortcuts without accessibility (#16125)

Fixed crash on macOS when using globalShortcut for media keys when accessibility access is not granted.
This commit is contained in:
Shelley Vohr 2019-01-03 20:40:17 -08:00 committed by GitHub
parent b57046e67d
commit 876064036d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 3 deletions

View file

@ -437,6 +437,7 @@ std::string SystemPreferences::GetSystemColor(const std::string& color,
}
}
// static
bool SystemPreferences::IsTrustedAccessibilityClient(bool prompt) {
NSDictionary* options = @{(id)kAXTrustedCheckOptionPrompt : @(prompt)};
return AXIsProcessTrustedWithOptions((CFDictionaryRef)options);