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

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