JBR-4204 provide an option to disable a11y support on macOS

(cherry picked from commit ee3c56abdc)
(cherry picked from commit e2419baf87)
This commit is contained in:
Anton Tarasov
2022-01-26 17:55:44 +03:00
committed by jbrbot
parent 0d7cb284e1
commit 84d43b79b3

View File

@@ -687,6 +687,10 @@ extern bool isSystemShortcut_NextWindowInApplication(NSUInteger modifiersMask, N
- (id)getAxData:(JNIEnv*)env
{
NSString *a11yEnabledProp = [PropertiesUtilities javaSystemPropertyForKey:@"sun.awt.mac.a11y.enabled" withEnv:env];
if ([@"false" isCaseInsensitiveLike:a11yEnabledProp]) {
return nil;
}
jobject jcomponent = [self awtComponent:env];
id ax = [[[CommonComponentAccessibility alloc] initWithParent:self withEnv:env withAccessible:jcomponent withIndex:-1 withView:self withJavaRole:nil] autorelease];
(*env)->DeleteLocalRef(env, jcomponent);