Commit 32370764 authored by Iain Lane's avatar Iain Lane Committed by Ray Strode

act-user-manager: Watch for the daemon going away and coming back

And set is-loaded accordingly. This causes properties to be invalidated
on the client side and then get re-fetched when the daemon comes back.

parent 229a7728
Pipeline #141663 passed with stage
in 58 seconds
...@@ -2298,6 +2298,23 @@ act_user_manager_queue_load (ActUserManager *manager) ...@@ -2298,6 +2298,23 @@ act_user_manager_queue_load (ActUserManager *manager)
} }
} }
static void
on_name_owner_changed (GObject *object,
GParamSpec *pspec,
gpointer user_data)
ActUserManager *manager = ACT_USER_MANAGER (user_data);
GDBusProxy *accounts_proxy = G_DBUS_PROXY (object);
g_autofree gchar *owner = NULL;
g_return_if_fail (ACT_IS_USER_MANAGER (manager));
g_return_if_fail (accounts_proxy != NULL);
owner = g_dbus_proxy_get_name_owner (accounts_proxy);
set_is_loaded (manager, owner != NULL);
static gboolean static gboolean
ensure_accounts_proxy (ActUserManager *manager) ensure_accounts_proxy (ActUserManager *manager)
{ {
...@@ -2335,6 +2352,10 @@ ensure_accounts_proxy (ActUserManager *manager) ...@@ -2335,6 +2352,10 @@ ensure_accounts_proxy (ActUserManager *manager)
"user-deleted", "user-deleted",
G_CALLBACK (on_user_removed_in_accounts_service), G_CALLBACK (on_user_removed_in_accounts_service),
manager); manager);
g_signal_connect (priv->accounts_proxy,
G_CALLBACK (on_name_owner_changed),
return TRUE; return TRUE;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment