diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2022-08-24 11:42:04 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2022-08-24 19:05:35 +0200 |
commit | 812fe185fba48b439fb1229517d62aa67c209016 (patch) | |
tree | 46f8c31fc22b3b80ca3b5efff0f9d8b5fcac693e /desktop | |
parent | 9931d6b1fb0406e16d56e186812884511738dcfa (diff) |
qt a11y: Remember and reuse existing QObject for XAccessible
Previously, a new `QtXAccessible` object was created
for an `XAccessible` each time before
`QAccessible::queryAccessibleInterface` was called,
which is not only unnecessary but also causes
various issues, e.g. it breaks walking the a11y hierarchy
upwards (i.e. from children to parents), since a new
object is created for the parent.
This introduces `QtAccessibleRegistry` that keeps
a mapping between the `XAccessible` and
the associated `QObject`. That mapping is used
to reuse already created objects instead of creating
new ones for the same `XAccessible`.
The entry for an `XAccessible` is removed again from the
map in `QtAccessibleWidget::invalidate`, which gets called
when the `XAccessible` gets disposed,
s. `QtAccessibleEventListener::disposing`.
With this in place, Orca now also nicely announces
only the text of the push buttons themselves in the "Save Document?"
dialog when switching between the buttons using the
Tab key, rather than announcing the whole widget hierarchy
every time (probably because creating a new object every time
prevented Orca from recognizing that the previously selected
pushbutton and the newly selected one are siblings, i.e.
have the same parent object.)
Change-Id: Ic890a387ff016e889f25dba70c82d0d81ae7a9e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138757
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'desktop')
0 files changed, 0 insertions, 0 deletions