From a4ac1d644dc695e1528f85e493da1e1668f28d25 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 15 Jul 2022 17:00:49 -0300 Subject: [PATCH] user-selector: Purge items after listing users The first call to act_user_manager_list_users() may lazily load and notify the 'is-loaded' property, in which case we end up indirectly recursing into reload_users(). Because we recurse *after* purging carousel items, the same user is added twice: once in the leaf recursion call, and once again in the call that notified the 'is-loaded' property. A simple workaround to this is purging carousel items after the call to act_user_manager_list_users(). --- malcontent-control/user-selector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/malcontent-control/user-selector.c b/malcontent-control/user-selector.c index 0d7f224..8c02844 100644 --- a/malcontent-control/user-selector.c +++ b/malcontent-control/user-selector.c @@ -370,11 +370,11 @@ reload_users (MctUserSelector *self, g_object_get (settings, "gtk-enable-animations", &animations, NULL); g_object_set (settings, "gtk-enable-animations", FALSE, NULL); - mct_carousel_purge_items (self->carousel); - list = act_user_manager_list_users (self->user_manager); g_debug ("Got %u users", g_slist_length (list)); + mct_carousel_purge_items (self->carousel); + list = g_slist_sort (list, (GCompareFunc) sort_users); for (l = list; l; l = l->next) {