aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/restore_session_lock.patch
blob: ef4effb274fbf89231bd6992040c960bcd49e9ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
=== modified file 'src/user-menu-mgr.c'
--- src/user-menu-mgr.c	2012-02-10 07:33:14 +0000
+++ src/user-menu-mgr.c	2012-02-23 18:19:12 +0000
@@ -285,11 +285,29 @@
 	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 @@
   UserData *user = (UserData *)user_data;
   UsersServiceDbus *service = user->service;
 
+  lock_if_possible();
+
   users_service_dbus_activate_user_session (service, user);
 }
 
@@ -386,7 +406,11 @@
   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;
+  }
 }