790730a9b7
As mentioned/worked around in Colomban's pending Gerrit change to implement an a11y test for the "Special Characters" dialog [1], the selected item in the character table was incorrectly still reporting the "focused" state even if keyboard focus already moved on from the parent widget to another one. Fix this by checking the item is not only selected, but its parent also has child focus. Tested by running this pyatspi script after a sleep and using the time before the script actually runs to interact with the dialog to test the different scenarios for the focused state, using the "!" character in the dialog): #!/usr/bin/python3 import pyatspi def get_soffice_app(): registry = pyatspi.registry.Registry() apps = list(registry.getDesktop(0)) for app in apps: if app.name == 'soffice' or app.name == 'soffice.bin': return app print("soffice app not found") exit(1) def get_exclamation_mark_button(acc): i = 0 while i < acc.get_child_count(): child = acc.get_child_at_index(i) try: if child.name == '!': return child except NotImplementedError: pass recursive_child = get_exclamation_mark_button(child) if recursive_child: return recursive_child i = i + 1 return None app = get_soffice_app() obj = get_exclamation_mark_button(app) assert obj states = obj.get_state_set().get_states() print("states:") print(states) [1] https://gerrit.libreoffice.org/c/core/+/142260/22/sw/qa/extras/accessibility/dialogs.cxx Change-Id: I277890105e3ff84ed35100b7cd7dc2ff40510921 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147660 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> |
||
---|---|---|
.. | ||
accessibility | ||
core | ||
customshapes | ||
diagram | ||
dialog | ||
engine3d | ||
fmcomp | ||
form | ||
gallery2 | ||
gengal | ||
inc | ||
items | ||
mnuctrls | ||
sdr | ||
sidebar | ||
smarttags | ||
stbctrls | ||
styles | ||
svdraw | ||
table | ||
tbxctrls | ||
theme | ||
toolbars | ||
uitest | ||
unodialogs/textconversiondlgs | ||
unodraw | ||
unogallery | ||
xml | ||
xoutdev |