summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@novell.com>2012-02-28 14:26:57 -0600
committerMike Gorse <mgorse@novell.com>2012-02-28 14:32:47 -0600
commita25bc4befa2b7d3cfda0de65398e7562f572c8da (patch)
tree8e86a396aa5fd4c3f4abb164a21b97befdd31914
parent781bcaceee6ac1ee185cff3f29d0e36a82725923 (diff)
downloadat-spi2-core-a25bc4befa2b7d3cfda0de65398e7562f572c8da.tar.gz
Don't cache data for transient objects
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.
-rw-r--r--atspi/atspi-accessible.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 1cd1d7b9..468c384c 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -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);
}