summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-07-20 10:07:32 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2023-07-21 15:02:45 +0200
commit1c0f0ab9b5bf23997640f44b7edd45c693c3f74d (patch)
tree6ea27287833edb7af73d20098dcfbc64ab0e3819 /vcl
parent29ab560c21b80e9e5886a8f507300d61047d0ee7 (diff)
tdf#99609 a11y: Handle focused state for cells in tab list box
Report the focusable state for cells in the tab list box, and the focused state when the row is selected and child focus is on the table or a child. Not properly reporting the focused state would e.g. prevent Orca from announcing the newly focused row in the Expert Configuration dialog when using the qt6 VCL plugin. (It already worked fine with gtk3 because that one is using native Gtk widgets.) This at least makes the focused state being reported properly for the first item ("org.openoffice.VCL") in the Expoert Configuration dialog, but others still happen to not have the focused state set properly when moving there with the arrow down key, so there seems to be another issue somewhere. pyatspi script that prints state change events: #!/usr/bin/python3 import pyatspi def listener(e): try: if e.host_application.name != 'soffice' and e.host_application.name != 'soffice.bin': return except: return print(e) pyatspi.Registry.registerEventListener(listener, 'object:state-changed') pyatspi.Registry.start() Sample output when moving between entries in the table (only "org.openoffice.VCL") has focused state set. object:state-changed:focused(1, 0, [table | ]) source: [table | ] host_application: [application | soffice.bin] sender: [application | soffice.bin] object:state-changed:focused(1, 0, [table | ]) source: [table | ] host_application: [application | soffice.bin] sender: [application | soffice.bin] object:state-changed:focused(0, 0, [table cell | org.openoffice.Inet]) source: [table cell | org.openoffice.Inet] host_application: [application | soffice.bin] sender: [application | soffice.bin] object:state-changed:focused(1, 0, [table cell | org.openoffice.VCL]) source: [table cell | org.openoffice.VCL] host_application: [application | soffice.bin] sender: [application | soffice.bin] object:state-changed:focused(0, 0, [table cell | org.openoffice.Inet]) source: [table cell | org.openoffice.Inet] host_application: [application | soffice.bin] sender: [application | soffice.bin] object:state-changed:focused(0, 0, [table cell | org.openoffice.LDAP]) source: [table cell | org.openoffice.LDAP] host_application: [application | soffice.bin] sender: [application | soffice.bin] object:state-changed:focused(0, 0, [table cell | org.openoffice.Setup]) source: [table cell | org.openoffice.Setup] host_application: [application | soffice.bin] sender: [application | soffice.bin] Change-Id: I6b532bfd6c3f437e44b3d67da8a5cc5f77b562d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154671 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/treelist/svtabbx.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index 6b8119c1b2d5..2699ec4cfcf6 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -1005,6 +1005,7 @@ void SvHeaderTabListBox::FillAccessibleStateSet( sal_Int64& _rStateSet, Accessib
void SvHeaderTabListBox::FillAccessibleStateSetForCell( sal_Int64& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumn ) const
{
+ _rStateSet |= AccessibleStateType::FOCUSABLE;
_rStateSet |= AccessibleStateType::SELECTABLE;
_rStateSet |= AccessibleStateType::TRANSIENT;
@@ -1017,6 +1018,8 @@ void SvHeaderTabListBox::FillAccessibleStateSetForCell( sal_Int64& _rStateSet, s
if ( IsRowSelected( _nRow ) )
{
_rStateSet |= AccessibleStateType::ACTIVE;
+ if (HasChildPathFocus())
+ _rStateSet |= AccessibleStateType::FOCUSED;
_rStateSet |= AccessibleStateType::SELECTED;
}
if ( IsEnabled() )