diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-08-18 12:20:19 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-08-18 12:20:19 +0100 |
commit | 1909ed838f14287d156e3ad9d619f7604534dae6 (patch) | |
tree | e8105894067736a8e919a76a872338fef518c38d /src/user-menu-mgr.c | |
parent | ce792a6c67408779b7741194a8aa19caa86e0ef8 (diff) | |
parent | c2266fe6e875f30b409b97755aeca512fc2be690 (diff) | |
download | ayatana-indicator-session-1909ed838f14287d156e3ad9d619f7604534dae6.tar.gz ayatana-indicator-session-1909ed838f14287d156e3ad9d619f7604534dae6.tar.bz2 ayatana-indicator-session-1909ed838f14287d156e3ad9d619f7604534dae6.zip |
ted's merge in for correctly checking active sessions plus UI now correct with regards active sessions and guest session is also in
Diffstat (limited to 'src/user-menu-mgr.c')
-rw-r--r-- | src/user-menu-mgr.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 6f9f53a..f2757ad 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -26,8 +26,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "lock-helper.h" #include "users-service-dbus.h" -#define GUEST_SESSION_LAUNCHER "/usr/share/gdm/guest-session/guest-session-launch" - static GConfClient * gconf_client = NULL; static DbusmenuMenuitem *switch_menuitem = NULL; @@ -227,7 +225,7 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self) } dbusmenu_menuitem_property_set_bool (mi, USER_ITEM_PROP_LOGGED_IN, - /*user->sessions != NULL*/FALSE); + user->sessions != NULL); if (user->icon_file != NULL && user->icon_file[0] != '\0') { dbusmenu_menuitem_property_set(mi, USER_ITEM_PROP_ICON, user->icon_file); } else { @@ -397,11 +395,6 @@ check_guest_session (void) this would be the case of the guest user itself. */ return FALSE; } - if (!g_file_test(GUEST_SESSION_LAUNCHER, G_FILE_TEST_IS_EXECUTABLE)) { - /* It doesn't appear that the Guest session stuff is - installed. So let's not use it then! */ - return FALSE; - } return TRUE; } @@ -410,25 +403,15 @@ check_guest_session (void) static void activate_guest_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data) { - GError * error = NULL; - UserData *user = (UserData *)user_data; - UsersServiceDbus *service = user->service; + g_return_if_fail (USER_IS_MENU_MGR (user_data)); + UserMenuMgr* user_mgr = USER_MENU_MGR(user_data); + UsersServiceDbus *service = user_mgr->users_dbus_interface; lock_if_possible(); - - if (dbusmenu_menuitem_property_get_bool(mi, USER_ITEM_PROP_LOGGED_IN)) { - if (users_service_dbus_activate_guest_session(service)) { - return; - } - g_warning("Unable to activate guest session, falling back to command line activation."); - } - - if (!g_spawn_command_line_async(GUEST_SESSION_LAUNCHER " --no-lock", &error)) { - g_warning("Unable to start guest session: %s", error->message); - g_error_free(error); - } - - return; + + if (users_service_dbus_activate_guest_session(service)) { + return; + } } |