Bug 1773745: Add FullKeyboardAccess to A11Y_INSTANTIATORS r=eeejay,spohl

Differential Revision: https://phabricator.services.mozilla.com/D148941
This commit is contained in:
Morgan Reschenberg 2022-06-13 22:38:42 +00:00
Родитель 8d68418a04
Коммит 574b6f1192
1 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -211,7 +211,20 @@ void ProxyRoleChangedEvent(RemoteAccessible* aTarget, const a11y::role& aRole) {
[[NSWorkspace sharedWorkspace] isSwitchControlEnabled]) {
client.Assign(u"SwitchControl"_ns);
} else {
client.Assign(u"Unknown"_ns);
// This is more complicated than the NSWorkspace queries above
// because (a) there is no "full keyboard access" query for NSWorkspace
// and (b) the [NSApplication fullKeyboardAccessEnabled] query checks
// the pre-Monterey version of full keyboard access, which is not what
// we're looking for here. For more info, see bug 1772375 comment 7.
Boolean exists;
int val = CFPreferencesGetAppIntegerValue(
CFSTR("FullKeyboardAccessEnabled"),
CFSTR("com.apple.Accessibility"), &exists);
if (exists && val == 1) {
client.Assign(u"FullKeyboardAccess"_ns);
} else {
client.Assign(u"Unknown"_ns);
}
}
#if defined(MOZ_TELEMETRY_REPORTING)