Don't cache data for transient objects
authorMike Gorse <mgorse@novell.com>
Tue, 28 Feb 2012 20:26:57 +0000 (14:26 -0600)
committerMike Gorse <mgorse@novell.com>
Tue, 28 Feb 2012 20:32:47 +0000 (14:32 -0600)
If an object is known to be transient, then ignore its cache, since it
seems better not to rely on a toolkit to send updates for transient
objects.
Note that this isn't really a complete solution, since it only disables
the cache if STATE_TRANSIENT is known to be present. If AddAccessible
was not sent for the object and atspi_accessible_get_state_set has not
been called, then the state set is not known, so STATE_TRANSIENT is not
"known to be present..." It may be a good idea to fetch the state set if
it is not known, or check the parent for STATE_MANAGES_DESCENDANTS,
although in the latter case it is also possible that the parent's state
set is not known, and it may be needed to check the parent's parent and
so on.

atspi/atspi-accessible.c

index 1cd1d7b..468c384 100644 (file)
@@ -1554,6 +1554,8 @@ _atspi_accessible_test_cache (AtspiAccessible *accessible, AtspiCache flag)
 {
   AtspiCache mask = _atspi_accessible_get_cache_mask (accessible);
   AtspiCache result = accessible->cached_properties & mask & flag;
+  if (accessible->states && atspi_state_set_contains (accessible->states, ATSPI_STATE_TRANSIENT))
+    return FALSE;
   return (result != 0 && atspi_main_loop && !atspi_no_cache);
 }