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

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