diff options
author | Ted Gould <ted@gould.cx> | 2011-08-17 15:59:40 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-08-17 15:59:40 -0500 |
commit | 381110b4d8fac1a5d557711c348bb3324624c9ae (patch) | |
tree | 5456c7ee37c362baaf8c9c1c357a43168b5eba25 /src | |
parent | f964233610d587af1ef67dd7fa5db84d7cc9ae3c (diff) | |
download | ayatana-indicator-session-381110b4d8fac1a5d557711c348bb3324624c9ae.tar.gz ayatana-indicator-session-381110b4d8fac1a5d557711c348bb3324624c9ae.tar.bz2 ayatana-indicator-session-381110b4d8fac1a5d557711c348bb3324624c9ae.zip |
After setting up the signals get the initial list of sessions
Diffstat (limited to 'src')
-rw-r--r-- | src/users-service-dbus.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c index 83edaa3..f87d381 100644 --- a/src/users-service-dbus.c +++ b/src/users-service-dbus.c @@ -36,6 +36,7 @@ #include "accounts-service-client.h" #include "consolekit-manager-client.h" #include "consolekit-session-client.h" +#include "consolekit-seat-client.h" #define CK_ADDR "org.freedesktop.ConsoleKit" #define CK_SESSION_IFACE "org.freedesktop.ConsoleKit.Session" @@ -315,6 +316,23 @@ create_ck_proxy (UsersServiceDbus *self) } } +/* Get the initial sessions when starting up */ +static void +get_cksessions_cb (DBusGProxy *proxy, GPtrArray * sessions, GError * error, gpointer userdata) +{ + if (error != NULL) { + g_warning("Unable to get initial sessions: %s", error->message); + return; + } + + int i; + for (i = 0; i < sessions->len; i++) { + seat_proxy_session_added(proxy, g_ptr_array_index(sessions, i), USERS_SERVICE_DBUS(userdata)); + } + + return; +} + static void create_seat_proxy (UsersServiceDbus *self) { @@ -363,6 +381,10 @@ create_seat_proxy (UsersServiceDbus *self) G_CALLBACK (seat_proxy_session_removed), self, NULL); + + org_freedesktop_ConsoleKit_Seat_get_sessions_async (priv->seat_proxy, get_cksessions_cb, self); + + return; } static void |