[at-spi2-core] Don't cache data for transient objects



commit a25bc4befa2b7d3cfda0de65398e7562f572c8da
Author: Mike Gorse <mgorse novell com>
Date:   Tue Feb 28 14:26:57 2012 -0600

    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.

 atspi/atspi-accessible.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 1cd1d7b..468c384 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);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]