Skip to content
Snippets Groups Projects
Commit 5217167a authored by Joanmarie Diggs's avatar Joanmarie Diggs
Browse files

Hack around Qt giving us a new cell every time we ask for a child

a6116995 broke presentation of Qt cells in QTreeView. That change
eliminated some chattiness by not presenting the name of an object
that was not the focused object if the name was identical. It turns
out that when we go to generate the name for one of these cells, the
equality check fails. We get a new copy of the object every time we
ask for the child via index.

As a safe hackaround in time for the release candidate, only do
the chattiness reduction if obj is not focus and obj and focus have
different roles. That should solve chattiness in the case of popups
with the same name as the focused object, as well as the redundant
labelling we're seeing in GTK4 (libadwaita) apps.

See issue #535.
parent 7b097970
No related branches found
No related tags found
1 merge request!10New release: 47RC.
......@@ -353,7 +353,10 @@ class Generator:
@log_generator_output
def _generate_accessible_label_and_name(self, obj, **args):
focus = focus_manager.get_manager().get_locus_of_focus()
if focus and obj != focus:
# TODO - JD: The role check is a quick workaround for issue #535 in which we stopped
# presenting Qt table cells because Qt keeps giving us a different object each and
# every time we ask for the cell. File a bug against Qt to get them to stop that.
if focus and obj != focus and AXObject.get_role(obj) != AXObject.get_role(focus):
name = AXObject.get_name(obj)
if name and name in [AXObject.get_name(focus), AXObject.get_description(focus)]:
return []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment