summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-10-31 17:45:57 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2023-11-01 21:21:01 +0100
commit64d7bb1917c38ad8e256a482778df647904f5502 (patch)
tree13362f07788992e0059ed9bd0b5e476e84179b0f /vcl
parent691604d9037e72a94207d643cba29c64260b1cb9 (diff)
macOS a11y: Don't report (non-)expanded state when not expandable
When the a11y object is not expandable, also don't report a true/false value for the expanded state on macOS. Otherwise, the CrossOver screen reader on macOS will explicitly announce "collapsed" for these objects, e.g. when moving focus between paragraphs in Writer (as reported on the a11y mailing list [1]) or between toolbar butons, since `isAccessibilityExpanded` gets called and returns false, so it is assumed that this is an expandable item that is currently not expanded, i.e. it is collapsed. Quoting from the NSAccessibilityProtocol doc [2]: > You can control which accessor methods the assistive app can > use by overriding isAccessibilitySelectorAllowed(_:). > Return true if the assistive app can call the selector; > otherwise, return false." [1] https://listarchives.libreoffice.org/global/accessibility/msg01068.html [2] https://developer.apple.com/documentation/appkit/nsaccessibilityprotocol: Change-Id: Iac9027a598e5793d6bd0da79212d7b07448a4c34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158733 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/osx/a11ywrapper.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index 887ea024ca44..df1d3690df6d 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -1575,6 +1575,14 @@ static Reference < XAccessibleContext > hitTestRunner ( css::awt::Point point,
if ( ! aSelector )
return NO;
+ // don't explicitly report (non-)expanded state when not expandable
+ if (aSelector == @selector(isAccessibilityExpanded))
+ {
+ const sal_Int64 nStateSet = [ self accessibleContext ] -> getAccessibleStateSet();
+ if (!( nStateSet & AccessibleStateType::EXPANDABLE))
+ return false;
+ }
+
if ( [ self respondsToSelector: aSelector ] ) {
// Ignore actions if action is not supported
NSAccessibilityActionName pActionName = [ AquaA11yActionWrapper actionNameForSelector: aSelector ];