mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-22 20:51:23 -05:00
macOS 10.15: Request screen reader permission for AutoType
* Fix #3609 - Request screen reader permission by faking a 1px screenshot. Thanks to MacPass for this idea. * Fix #3578 - Remove duplicate sandbox entitlement * Fix #3270 - Use executable path reference for libquazip
This commit is contained in:
parent
dbe15d32e5
commit
e50261a99c
@ -8,8 +8,6 @@
|
||||
<string>production</string>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.print</key>
|
||||
<true/>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
|
@ -105,6 +105,8 @@ if(APPLE AND WITH_APP_BUNDLE)
|
||||
"@executable_path/../Frameworks/libyubikey.0.dylib"
|
||||
-change /usr/local/opt/ykpers/lib/libykpers-1.1.dylib
|
||||
"@executable_path/../Frameworks/libykpers-1.1.dylib"
|
||||
-change /usr/local/opt/quazip/lib/libquazip.1.dylib
|
||||
"@executable_path/../Frameworks/libquazip.1.dylib"
|
||||
keepassxc-cli
|
||||
COMMENT "Changing linking of keepassxc-cli")
|
||||
|
||||
|
@ -144,6 +144,17 @@ static const NSEventMask NSEventMaskKeyDown = NSKeyDownMask;
|
||||
//
|
||||
- (bool) enableAccessibility
|
||||
{
|
||||
// Request a 1 pixel screenshot to trigger the permissions
|
||||
// required for screen reader access. These are necessary
|
||||
// for Auto-Type to find the window titles in macOS 10.15+
|
||||
CGImageRef screenshot = CGWindowListCreateImage(
|
||||
CGRectMake(0, 0, 1, 1),
|
||||
kCGWindowListOptionOnScreenOnly,
|
||||
kCGNullWindowID,
|
||||
kCGWindowImageDefault);
|
||||
CFRelease(screenshot);
|
||||
|
||||
// Request accessibility permissions for Auto-Type type on behalf of the user
|
||||
NSDictionary* opts = @{static_cast<id>(kAXTrustedCheckOptionPrompt): @YES};
|
||||
return AXIsProcessTrustedWithOptions(static_cast<CFDictionaryRef>(opts));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user