summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2012-07-09 17:36:26 -0500
committerMike Gorse <mgorse@suse.com>2012-07-09 17:36:26 -0500
commitf734be9d27abe565c211dc2cd0f360e73fd32c1f (patch)
tree92ed2273e397d305467438b2d2cd2eb68787fa19
parent8e03fc29c9dc15f90cbb6433e05b55ab535658a1 (diff)
downloadat-spi2-atk-f734be9d27abe565c211dc2cd0f360e73fd32c1f.tar.gz
Only add items to the cache on children-changed if they are passed in
Gtk tree views, for instance, send children-changed signals without passing an object. If a toolkit does this, then assume that it is doing so because fetching the object would be expensive, and/or the object is transient, so just have the cache bypass the signal rather than ref the child in order to add it. Helps with performance when creating large gtk+ tree views. https://bugzilla.gnome.org/show_bug.cgi?id=674719
-rw-r--r--atk-adaptor/accessible-cache.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/atk-adaptor/accessible-cache.c b/atk-adaptor/accessible-cache.c
index c997b4a..a0922e6 100644
--- a/atk-adaptor/accessible-cache.c
+++ b/atk-adaptor/accessible-cache.c
@@ -321,7 +321,6 @@ child_added_listener (GSignalInvocationHint * signal_hint,
const GValue * param_values, gpointer data)
{
SpiCache *cache = spi_global_cache;
- gboolean child_needs_ref = TRUE;
AtkObject *accessible;
const gchar *detail = NULL;
@@ -351,14 +350,13 @@ child_added_listener (GSignalInvocationHint * signal_hint,
gpointer child;
int index = g_value_get_uint (param_values + 1);
child = g_value_get_pointer (param_values + 2);
-
- if (!ATK_IS_OBJECT (child))
+ if (!child)
{
- child = atk_object_ref_accessible_child (accessible, index);
- child_needs_ref = FALSE;
+ g_static_rec_mutex_unlock (&cache_mutex);
+ return;
}
- if (child_needs_ref)
- g_object_ref (child);
+
+ g_object_ref (child);
g_queue_push_tail (cache->add_traversal, child);
if (cache->add_pending_idle == 0)