aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2012-03-06 13:54:04 +0100
committerSebastien Bacher <seb128@ubuntu.com>2012-03-06 13:54:04 +0100
commit3c5b15aba9bb40ab8ef9c55df35941b67e52d31b (patch)
tree8621e20998fbe45065cdc6558d6e379755fc0875 /src
parent0f7af17c1ddb6f1b031135c6d0b0aaaeb0a86d29 (diff)
parentaabe8764970005779fe938e44c85b844eba220cc (diff)
downloadayatana-indicator-session-3c5b15aba9bb40ab8ef9c55df35941b67e52d31b.tar.gz
ayatana-indicator-session-3c5b15aba9bb40ab8ef9c55df35941b67e52d31b.tar.bz2
ayatana-indicator-session-3c5b15aba9bb40ab8ef9c55df35941b67e52d31b.zip
enforce locking that's still needed and will not be solved this cycle
Diffstat (limited to 'src')
-rw-r--r--src/user-menu-mgr.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c
index 7aad2af..3f4bdc4 100644
--- a/src/user-menu-mgr.c
+++ b/src/user-menu-mgr.c
@@ -285,11 +285,29 @@ check_new_session ()
return TRUE;
}
+/* Check to see if the lockdown key is protecting from
+ locking the screen. If not, lock it. */
+static void
+lock_if_possible (void) {
+ ensure_settings_client ();
+
+ if (!g_settings_get_boolean (settings, LOCKDOWN_KEY_SCREENSAVER)) {
+ lock_screen(NULL, 0, NULL);
+ }
+
+ return;
+}
+
+
/* Starts a new generic session */
static void
activate_new_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
{
- users_service_dbus_show_greeter (USERS_SERVICE_DBUS(user_data));
+ lock_if_possible();
+
+ users_service_dbus_show_greeter (USERS_SERVICE_DBUS(user_data));
+
+ return;
}
/* Activates a session for a particular user. */
@@ -299,6 +317,8 @@ activate_user_session (DbusmenuMenuitem *mi, guint timestamp, gpointer user_data
UserData *user = (UserData *)user_data;
UsersServiceDbus *service = user->service;
+ lock_if_possible();
+
users_service_dbus_activate_user_session (service, user);
}
@@ -386,7 +406,11 @@ activate_guest_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_da
UserMenuMgr* user_mgr = USER_MENU_MGR(user_data);
UsersServiceDbus *service = user_mgr->users_dbus_interface;
- users_service_dbus_activate_guest_session(service);
+ lock_if_possible();
+
+ if (users_service_dbus_activate_guest_session(service)) {
+ return;
+ }
}