~skypce/indicator-session/indicator-session

« back to all changes in this revision

Viewing changes to debian/patches/restore_session_lock.patch

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2012-03-06 16:06:57 UTC
  • Revision ID: package-import@ubuntu.com-20120306160657-wenbva5fs20lhhxs
Tags: 0.3.92-0ubuntu2
* Backport r243 and r244, should fix the restart required status update
  once aptdaemon is fixed to correctly emit signals (lp: #942104)
* debian/patches/restore_session_lock.patch, debian/rules:
  - replace by a backport of the official commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=== modified file 'src/user-menu-mgr.c'
2
 
--- src/user-menu-mgr.c 2012-02-10 07:33:14 +0000
3
 
+++ src/user-menu-mgr.c 2012-02-23 18:19:12 +0000
4
 
@@ -285,11 +285,29 @@
5
 
        return TRUE;
6
 
 }
7
 
 
8
 
+/* Check to see if the lockdown key is protecting from
9
 
+   locking the screen.  If not, lock it. */
10
 
+static void
11
 
+lock_if_possible (void) {
12
 
+       ensure_settings_client ();
13
 
+
14
 
+       if (!g_settings_get_boolean (settings, LOCKDOWN_KEY_SCREENSAVER)) {
15
 
+               lock_screen(NULL, 0, NULL);
16
 
+       }
17
 
+
18
 
+       return;
19
 
+}
20
 
+
21
 
+
22
 
 /* Starts a new generic session */
23
 
 static void
24
 
 activate_new_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
25
 
 {
26
 
-       users_service_dbus_show_greeter (USERS_SERVICE_DBUS(user_data));
27
 
+       lock_if_possible();
28
 
+
29
 
+  users_service_dbus_show_greeter (USERS_SERVICE_DBUS(user_data));
30
 
+
31
 
+       return;
32
 
 }
33
 
 
34
 
 /* Activates a session for a particular user. */
35
 
@@ -299,6 +317,8 @@
36
 
   UserData *user = (UserData *)user_data;
37
 
   UsersServiceDbus *service = user->service;
38
 
 
39
 
+  lock_if_possible();
40
 
+
41
 
   users_service_dbus_activate_user_session (service, user);
42
 
 }
43
 
 
44
 
@@ -386,7 +406,11 @@
45
 
   UserMenuMgr* user_mgr = USER_MENU_MGR(user_data);  
46
 
   UsersServiceDbus *service = user_mgr->users_dbus_interface;
47
 
 
48
 
-  users_service_dbus_activate_guest_session(service);
49
 
+       lock_if_possible();
50
 
+  
51
 
+  if (users_service_dbus_activate_guest_session(service)) {
52
 
+    return;
53
 
+  }
54
 
 }
55
 
 
56
 
 
57