Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Eliminate accessible children-changed event flood on container repopu…
…lation

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.
  • Loading branch information
joanmarie authored and lukefromdc committed May 3, 2018
1 parent 5e236e9 commit 99cf0ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libcaja-private/caja-icon-container.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions libcaja-private/caja-icon-private.h
Expand Up @@ -271,6 +271,7 @@ struct CajaIconContainerDetails
GQueue* a11y_item_action_queue;

eel_boolean_bit is_loading : 1;
eel_boolean_bit is_populating_container : 1;

eel_boolean_bit store_layout_timestamps : 1;
eel_boolean_bit store_layout_timestamps_when_finishing_new_icons : 1;
Expand Down

0 comments on commit 99cf0ca

Please sign in to comment.