From 99cf0cad9fc6ceb0f86066e85af242d2f46c3b88 Mon Sep 17 00:00:00 2001 From: Joanmarie Diggs Date: Thu, 26 Apr 2018 16:13:50 -0400 Subject: Eliminate accessible children-changed event flood on container repopulation When the icon container is repopulated (e.g. when using back/forward) finish_adding_new_icons is called leading to an accessible children- changed event flood. We can distinguish these unwanted notifications from desired notifications by comparing the number of new icons to add with the size of the container's icon set. --- libcaja-private/caja-icon-container.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libcaja-private/caja-icon-container.c') diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index e1db560d..cae3af44 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -7703,6 +7703,8 @@ finish_adding_new_icons (CajaIconContainer *container) new_icons = container->details->new_icons; container->details->new_icons = NULL; + container->details->is_populating_container = + g_list_length(new_icons) == g_hash_table_size(container->details->icon_set); /* Position most icons (not unpositioned manual-layout icons). */ new_icons = g_list_reverse (new_icons); @@ -9582,8 +9584,8 @@ caja_icon_container_accessible_icon_added_cb (CajaIconContainer *container, AtkObject *atk_child; int index; - // We don't want to emit children_changed signals during the initial load. - if (container->details->is_loading) + // We don't want to emit children_changed signals during any type of load. + if (container->details->is_loading || container->details->is_populating_container) return; icon = g_hash_table_lookup (container->details->icon_set, icon_data); -- cgit v1.2.1