We should have an attributes-changed signal for object attributes
TL;DR: Accerciser's event monitor suggests object:attributes-changed
is a valid event. My looking around suggests it is not. I think it should become an actual event.
Details:
- This signal is not in the ATK docs.
- To see if that was an oversight, I grepped through the code in
atk/
. I see a number of signals defined, none of which isattributes_changed
(i.e. on the accessible object; not the text interface). - In
atk-adaptor/event.c
, I see the listeners for all the events I found above, but no mention of anything related to object attributes changing. - To figure out where Accerciser got this event from, I looked at its code and discovered
pyatspi.EVENT_TREE
. Aha! - The
object:attributes-changed
event is listed in pyatspi.constants.py and appears to have been included in pyatspi2 from the very beginning (2008). That also appears to be the only place this event (or rather the associated event name) exists.
Let's make the object:attributes-changed
event a real thing, rather than remove it from pyatspi.EVENT_TREE
.
Use cases:
-
ARIA unfortunately has a lot of properties that don't have one-to-one mappings in ATK/AT-SPI2. Thus they get stuffed into yet another object attribute. I'd like to be notified when these values change because Orca might need to present something in response.
-
Orca currently has its own cache of object attributes for performance purposes. (See next item.) Sometimes that information gets stale. I currently try to guess which attributes might change and not use Orca's cached values in those cases. Sometimes I guess wrong. This could be solved by a signal.
-
Unless I'm missing something, every time Orca asks for object attributes, even though Orca is using AT-SPI2's cache for everything, a dbus call will occur. While there is
ATSPI_CACHE_ATTRIBUTES
, it's not included in the cache-related logic ofatspi-event-listener.c
. Which arguably is not surprising given that, as best as I can tell, this event does not (yet) exist. Being able to use the AT-SPI2 cache for object attributes would improve performance across the board -- once implementors start using it.