diff options
-rw-r--r-- | src/session-service.c | 7 | ||||
-rw-r--r-- | src/users-service-dbus.c | 8 | ||||
-rw-r--r-- | src/users-service-dbus.h | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/session-service.c b/src/session-service.c index fb20f3b..cb36e9c 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -386,6 +386,13 @@ activate_guest_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_da lock_if_possible(); + if (dbusmenu_menuitem_property_get_bool(mi, USER_ITEM_PROP_LOGGED_IN)) { + if (users_service_dbus_activate_guest_session(USERS_SERVICE_DBUS(user_data))) { + return; + } + g_warning("Unable to activate guest session, falling back to command line activation."); + } + if (!g_spawn_command_line_async(GUEST_SESSION_LAUNCHER, &error)) { g_warning("Unable to start guest session: %s", error->message); g_error_free(error); diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c index 4aefdff..556af98 100644 --- a/src/users-service-dbus.c +++ b/src/users-service-dbus.c @@ -1005,6 +1005,14 @@ users_service_dbus_get_user_list (UsersServiceDbus *self) return g_hash_table_get_values (priv->users); } +/* Activates the guest account if it can. */ +gboolean +users_service_dbus_activate_guest_session (UsersServiceDbus *self) +{ + + return FALSE; +} + gboolean users_service_dbus_activate_user_session (UsersServiceDbus *self, UserData *user) diff --git a/src/users-service-dbus.h b/src/users-service-dbus.h index bba88a7..29f6690 100644 --- a/src/users-service-dbus.h +++ b/src/users-service-dbus.h @@ -80,6 +80,7 @@ GList *users_service_dbus_get_user_list (UsersServiceDbus *self); gboolean users_service_dbus_can_activate_session (UsersServiceDbus *self); gboolean users_service_dbus_activate_user_session (UsersServiceDbus *self, UserData *user); +gboolean users_service_dbus_activate_guest_session (UsersServiceDbus *self); G_END_DECLS |