mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04: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>
|
<string>production</string>
|
||||||
<key>com.apple.security.network.client</key>
|
<key>com.apple.security.network.client</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
|
||||||
<true/>
|
|
||||||
<key>com.apple.security.print</key>
|
<key>com.apple.security.print</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.app-sandbox</key>
|
||||||
|
@ -105,6 +105,8 @@ if(APPLE AND WITH_APP_BUNDLE)
|
|||||||
"@executable_path/../Frameworks/libyubikey.0.dylib"
|
"@executable_path/../Frameworks/libyubikey.0.dylib"
|
||||||
-change /usr/local/opt/ykpers/lib/libykpers-1.1.dylib
|
-change /usr/local/opt/ykpers/lib/libykpers-1.1.dylib
|
||||||
"@executable_path/../Frameworks/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
|
keepassxc-cli
|
||||||
COMMENT "Changing linking of keepassxc-cli")
|
COMMENT "Changing linking of keepassxc-cli")
|
||||||
|
|
||||||
|
@ -144,6 +144,17 @@ static const NSEventMask NSEventMaskKeyDown = NSKeyDownMask;
|
|||||||
//
|
//
|
||||||
- (bool) enableAccessibility
|
- (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};
|
NSDictionary* opts = @{static_cast<id>(kAXTrustedCheckOptionPrompt): @YES};
|
||||||
return AXIsProcessTrustedWithOptions(static_cast<CFDictionaryRef>(opts));
|
return AXIsProcessTrustedWithOptions(static_cast<CFDictionaryRef>(opts));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user