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

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