aboutsummaryrefslogtreecommitdiff
path: root/src/users-service-dbus.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-08-10 18:01:29 +0100
committerConor Curran <conor.curran@canonical.com>2011-08-10 18:01:29 +0100
commit357374acb2a641a9c5d70cb6149293a0a07770f3 (patch)
tree8c8ac5869ebb4908f537e05f28db27261dabd180 /src/users-service-dbus.c
parenta1a7357b58d182e077ebfe8fb11c083e5eb18839 (diff)
parent853ad495b863c179792044f1a74e8556d04e32db (diff)
downloadayatana-indicator-session-357374acb2a641a9c5d70cb6149293a0a07770f3.tar.gz
ayatana-indicator-session-357374acb2a641a9c5d70cb6149293a0a07770f3.tar.bz2
ayatana-indicator-session-357374acb2a641a9c5d70cb6149293a0a07770f3.zip
merged the lightdb dbus changes and the apt restartrequired awareness
Diffstat (limited to 'src/users-service-dbus.c')
-rw-r--r--src/users-service-dbus.c47
1 files changed, 41 insertions, 6 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c
index 087378c..83edaa3 100644
--- a/src/users-service-dbus.c
+++ b/src/users-service-dbus.c
@@ -195,15 +195,50 @@ static void
create_display_manager_proxy (UsersServiceDbus *self)
{
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
+ DBusGProxy *dm_proxy = NULL;
+ GError *error = NULL;
+ const gchar *cookie = NULL;
+ gchar *seat = NULL;
+
+ cookie = g_getenv ("XDG_SESSION_COOKIE");
+ if (cookie == NULL || cookie[0] == 0)
+ {
+ g_warning ("Failed to get DisplayManager proxy: XDG_SESSION_COOKIE undefined.");
+ return;
+ }
+
+ dm_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
+ "org.freedesktop.DisplayManager",
+ "/org/freedesktop/DisplayManager",
+ "org.freedesktop.DisplayManager");
+
+ if (!dm_proxy)
+ {
+ g_warning ("Failed to get DisplayManager proxy.");
+ return;
+ }
+
+ /* Now request the proper seat */
+ if (!dbus_g_proxy_call (dm_proxy, "GetSeatForCookie", &error,
+ G_TYPE_STRING, cookie, G_TYPE_INVALID,
+ DBUS_TYPE_G_OBJECT_PATH, &seat, G_TYPE_INVALID))
+ {
+ g_warning ("Failed to get DisplayManager seat proxy: %s", error->message);
+ g_object_unref (dm_proxy);
+ g_error_free (error);
+ return;
+ }
+ g_object_unref (dm_proxy);
priv->display_manager_proxy = dbus_g_proxy_new_for_name (priv->system_bus,
"org.freedesktop.DisplayManager",
- "/org/freedesktop/DisplayManager",
- "org.freedesktop.DisplayManager");
+ seat,
+ "org.freedesktop.DisplayManager.Seat");
+ g_free (seat);
if (!priv->display_manager_proxy)
{
- g_warning ("Failed to get DisplayManager proxy.");
+ g_warning ("Failed to get DisplayManager seat proxy.");
return;
}
}
@@ -780,7 +815,7 @@ users_service_dbus_show_greeter (UsersServiceDbus *self)
{
g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
- return org_freedesktop_DisplayManager_show_greeter(priv->display_manager_proxy, NULL);
+ return org_freedesktop_DisplayManager_Seat_switch_to_greeter(priv->display_manager_proxy, NULL);
}
/* Activates the guest account if it can. */
@@ -789,7 +824,7 @@ users_service_dbus_activate_guest_session (UsersServiceDbus *self)
{
g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
- return org_freedesktop_DisplayManager_switch_to_guest(priv->display_manager_proxy, NULL);
+ return org_freedesktop_DisplayManager_Seat_switch_to_guest(priv->display_manager_proxy, "", NULL);
}
/* Activates a specific user */
@@ -799,7 +834,7 @@ users_service_dbus_activate_user_session (UsersServiceDbus *self,
{
g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE);
UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
- return org_freedesktop_DisplayManager_switch_to_user(priv->display_manager_proxy, user->user_name, NULL);
+ return org_freedesktop_DisplayManager_Seat_switch_to_user(priv->display_manager_proxy, user->user_name, "", NULL);
}
gboolean