Skip to content

Commit 99cf0ca

Browse files
joanmarielukefromdc
authored andcommitted
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.
1 parent 5e236e9 commit 99cf0ca

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

libcaja-private/caja-icon-container.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7703,6 +7703,8 @@ finish_adding_new_icons (CajaIconContainer *container)
77037703

77047704
new_icons = container->details->new_icons;
77057705
container->details->new_icons = NULL;
7706+
container->details->is_populating_container =
7707+
g_list_length(new_icons) == g_hash_table_size(container->details->icon_set);
77067708

77077709
/* Position most icons (not unpositioned manual-layout icons). */
77087710
new_icons = g_list_reverse (new_icons);
@@ -9582,8 +9584,8 @@ caja_icon_container_accessible_icon_added_cb (CajaIconContainer *container,
95829584
AtkObject *atk_child;
95839585
int index;
95849586

9585-
// We don't want to emit children_changed signals during the initial load.
9586-
if (container->details->is_loading)
9587+
// We don't want to emit children_changed signals during any type of load.
9588+
if (container->details->is_loading || container->details->is_populating_container)
95879589
return;
95889590

95899591
icon = g_hash_table_lookup (container->details->icon_set, icon_data);

libcaja-private/caja-icon-private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ struct CajaIconContainerDetails
271271
GQueue* a11y_item_action_queue;
272272

273273
eel_boolean_bit is_loading : 1;
274+
eel_boolean_bit is_populating_container : 1;
274275

275276
eel_boolean_bit store_layout_timestamps : 1;
276277
eel_boolean_bit store_layout_timestamps_when_finishing_new_icons : 1;

0 commit comments

Comments
 (0)