aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-16 20:51:22 -0500
committerTed Gould <ted@gould.cx>2010-03-16 20:51:22 -0500
commit5a06c7033c279c5421894ed99d01adb449568521 (patch)
treece0b7901b47f2ed4b16e85a55e4e3048deed0750 /src
parent1a451a7dbf5eed2b4ea8fd1e221bac036c3b9d4b (diff)
downloadayatana-indicator-session-5a06c7033c279c5421894ed99d01adb449568521.tar.gz
ayatana-indicator-session-5a06c7033c279c5421894ed99d01adb449568521.tar.bz2
ayatana-indicator-session-5a06c7033c279c5421894ed99d01adb449568521.zip
Switching both of these function to using the generated header file.
Diffstat (limited to 'src')
-rw-r--r--src/users-service-dbus.c58
1 files changed, 5 insertions, 53 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c
index 80ab5be..9e7af5d 100644
--- a/src/users-service-dbus.c
+++ b/src/users-service-dbus.c
@@ -1016,65 +1016,17 @@ users_service_dbus_get_user_list (UsersServiceDbus *self)
gboolean
users_service_dbus_activate_guest_session (UsersServiceDbus *self)
{
-
- return FALSE;
+ UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
+ return org_gnome_DisplayManager_LocalDisplayFactory_switch_to_user(priv->gdm_local_proxy, "guest", NULL, NULL);
}
+/* Activates a specific user */
gboolean
users_service_dbus_activate_user_session (UsersServiceDbus *self,
UserData *user)
{
- UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
- DBusMessage *message = NULL;
- DBusMessage *reply = NULL;
- DBusError error;
-
- dbus_error_init (&error);
-
- if (!(message = dbus_message_new_method_call ("org.gnome.DisplayManager",
- "/org/gnome/DisplayManager/LocalDisplayFactory",
- "org.gnome.DisplayManager.LocalDisplayFactory",
- "SwitchToUser")))
- {
- g_warning ("failed to create new message");
- return FALSE;
- }
-
- if (!dbus_message_append_args (message,
- DBUS_TYPE_STRING, &user->user_name,
- DBUS_TYPE_INVALID))
- {
- g_warning ("failed to append args");
- return FALSE;
- }
-
- if (!(reply = dbus_connection_send_with_reply_and_block (dbus_g_connection_get_connection (priv->system_bus),
- message,
- -1,
- &error)))
- {
- if (dbus_error_is_set (&error))
- {
- g_warning ("Failed to send message: %s", error.message);
- dbus_error_free (&error);
-
- return FALSE;
- }
- }
-
- if (message)
- {
- dbus_message_unref (message);
- }
-
- if (reply)
- {
- dbus_message_unref (reply);
- }
-
- dbus_error_free (&error);
-
- return TRUE;
+ UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self);
+ return org_gnome_DisplayManager_LocalDisplayFactory_switch_to_user(priv->gdm_local_proxy, user->user_name, NULL, NULL);
}
gboolean