Blame SOURCES/0001-lib-don-t-set-loaded-state-until-seat-is-fetched.patch

fe5089
From c7fa612023a163e8b2352e1170c6df3fceb19b27 Mon Sep 17 00:00:00 2001
fe5089
From: Ray Strode <rstrode@redhat.com>
fe5089
Date: Thu, 19 Jul 2018 13:14:09 -0400
fe5089
Subject: [PATCH] lib: don't set loaded state until seat is fetched
fe5089
fe5089
At the moment we set is-loaded on the user-manager
fe5089
object as soon as we start fetching the seat, but
fe5089
we should waiting until the seat is fetched, so
fe5089
that can_switch() will return the correct value
fe5089
if the caller waited until the loaded signal
fe5089
to use it.
fe5089
fe5089
This commit changes the >= to > which I believe
fe5089
was the original intention anyway.
fe5089
fe5089
https://bugs.freedesktop.org/show_bug.cgi?id=107298
fe5089
---
fe5089
 src/libaccountsservice/act-user-manager.c | 2 +-
fe5089
 1 file changed, 1 insertion(+), 1 deletion(-)
fe5089
fe5089
diff --git a/src/libaccountsservice/act-user-manager.c b/src/libaccountsservice/act-user-manager.c
fe5089
index 325421b..e7e26b1 100644
fe5089
--- a/src/libaccountsservice/act-user-manager.c
fe5089
+++ b/src/libaccountsservice/act-user-manager.c
fe5089
@@ -2355,61 +2355,61 @@ act_user_manager_list_users (ActUserManager *manager)
fe5089
                         queue_load_seat_incrementally (manager);
fe5089
         }
fe5089
 
fe5089
         retval = NULL;
fe5089
         g_hash_table_foreach (manager->priv->normal_users_by_name, listify_hash_values_hfunc, &retval);
fe5089
 
fe5089
         return g_slist_sort (retval, (GCompareFunc) act_user_collate);
fe5089
 }
fe5089
 
fe5089
 static void
fe5089
 maybe_set_is_loaded (ActUserManager *manager)
fe5089
 {
fe5089
         if (manager->priv->is_loaded) {
fe5089
                 g_debug ("ActUserManager: already loaded, so not setting loaded property");
fe5089
                 return;
fe5089
         }
fe5089
 
fe5089
         if (manager->priv->getting_sessions) {
fe5089
                 g_debug ("ActUserManager: GetSessions call pending, so not setting loaded property");
fe5089
                 return;
fe5089
         }
fe5089
 
fe5089
         if (manager->priv->new_users_inhibiting_load != NULL) {
fe5089
                 g_debug ("ActUserManager: Loading new users, so not setting loaded property");
fe5089
                 return;
fe5089
         }
fe5089
 
fe5089
         /* Don't set is_loaded yet unless the seat is already loaded enough
fe5089
          * or failed to load.
fe5089
          */
fe5089
-        if (manager->priv->seat.state >= ACT_USER_MANAGER_SEAT_STATE_GET_ID) {
fe5089
+        if (manager->priv->seat.state > ACT_USER_MANAGER_SEAT_STATE_GET_ID) {
fe5089
                 g_debug ("ActUserManager: Seat loaded, so now setting loaded property");
fe5089
         } else if (manager->priv->seat.state == ACT_USER_MANAGER_SEAT_STATE_UNLOADED) {
fe5089
                 g_debug ("ActUserManager: Seat wouldn't load, so giving up on it and setting loaded property");
fe5089
         } else {
fe5089
                 g_debug ("ActUserManager: Seat still actively loading, so not setting loaded property");
fe5089
                 return;
fe5089
         }
fe5089
 
fe5089
         set_is_loaded (manager, TRUE);
fe5089
 }
fe5089
 
fe5089
 
fe5089
 static GSList *
fe5089
 slist_deep_copy (const GSList *list)
fe5089
 {
fe5089
         GSList *retval;
fe5089
         GSList *l;
fe5089
 
fe5089
         if (list == NULL)
fe5089
                 return NULL;
fe5089
 
fe5089
         retval = g_slist_copy ((GSList *) list);
fe5089
         for (l = retval; l != NULL; l = l->next) {
fe5089
                 l->data = g_strdup (l->data);
fe5089
         }
fe5089
 
fe5089
         return retval;
fe5089
 }
fe5089
 
fe5089
 static void
fe5089
-- 
fe5089
2.17.1
fe5089