aboutsummaryrefslogtreecommitdiff
path: root/src/users-service-dbus.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-08-18 15:24:01 +0100
committerConor Curran <conor.curran@canonical.com>2011-08-18 15:24:01 +0100
commit92765fe97bdeb68f7f38cf57e478529db95cc09e (patch)
tree1606faefa181917a86855e18e314e189da808101 /src/users-service-dbus.c
parentd8d6677e2d184bde9ba5e136ed5c6edf30c20efc (diff)
parentdce6ee5caccdf9f9683bad26d062671a889792ee (diff)
downloadayatana-indicator-session-92765fe97bdeb68f7f38cf57e478529db95cc09e.tar.gz
ayatana-indicator-session-92765fe97bdeb68f7f38cf57e478529db95cc09e.tar.bz2
ayatana-indicator-session-92765fe97bdeb68f7f38cf57e478529db95cc09e.zip
merge in the big fix branch
Diffstat (limited to 'src/users-service-dbus.c')
-rw-r--r--src/users-service-dbus.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c
index 83edaa3..e7507a4 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,28 @@ 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;
+ }
+
+ /* If there's no error we should at least get an
+ array of zero entries */
+ g_return_if_fail(sessions != NULL);
+ g_debug("Got %d initial sessions", sessions->len);
+
+ 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 +386,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
@@ -556,7 +583,11 @@ static void
add_sessions_for_user (UsersServiceDbus *self,
UserData *user)
{
- g_return_if_fail(IS_USERS_SERVICE_DBUS(self));
+ g_return_if_fail (IS_USERS_SERVICE_DBUS(self));
+
+ g_debug ("!!!!!!!!!! - add_sessions_for_user %i %s",
+ (int)user->uid, user->user_name);
+
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
GError *error;
GPtrArray *sessions;