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