ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #01178
[Merge] lp:~ted/indicator-session/lock-on-switch into lp:indicator-session
Ted Gould has proposed merging lp:~ted/indicator-session/lock-on-switch into lp:indicator-session with lp:~ted/indicator-session/screensaver-gconf-key as a prerequisite.
Requested reviews:
Indicator Applet Developers (indicator-applet-developers)
Make it so that when we switch users we lock the screen first.
--
https://code.launchpad.net/~ted/indicator-session/lock-on-switch/+merge/21421
Your team ayatana-commits is subscribed to branch lp:indicator-session.
=== modified file 'src/lock-helper.c'
--- src/lock-helper.c 2010-02-08 16:59:44 +0000
+++ src/lock-helper.c 2010-03-16 02:39:14 +0000
@@ -182,7 +182,7 @@
{
g_debug("Lock Screen");
if (!will_lock_screen()) {
- g_debug("\tGDM set to autologin, blocking lock");
+ g_debug("\tUser is guest, blocking lock");
return;
}
=== modified file 'src/session-service.c'
--- src/session-service.c 2010-03-16 02:39:14 +0000
+++ src/session-service.c 2010-03-16 02:39:14 +0000
@@ -129,6 +129,20 @@
return;
}
+/* Check to see if the lockdown key is protecting from
+ locking the screen. If not, lock it. */
+static void
+lock_if_possible (void) {
+ ensure_gconf_client ();
+
+ if (!gconf_client_get_bool (gconf_client, LOCKDOWN_KEY_SCREENSAVER, NULL)) {
+ lock_screen(NULL, 0, NULL);
+ }
+
+ return;
+}
+
+
/* A return from the command to sleep the system. Make sure
that we unthrottle the screensaver. */
static void
@@ -150,7 +164,7 @@
}
screensaver_throttle(type);
- lock_screen(NULL, 0, NULL);
+ lock_if_possible();
dbus_g_proxy_begin_call(up_main_proxy,
type,
@@ -340,6 +354,9 @@
activate_guest_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
{
GError * error = NULL;
+
+ lock_if_possible();
+
if (!g_spawn_command_line_async(GUEST_SESSION_LAUNCHER, &error)) {
g_warning("Unable to start guest session: %s", error->message);
g_error_free(error);
@@ -380,6 +397,9 @@
activate_new_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
{
GError * error = NULL;
+
+ lock_if_possible();
+
if (!g_spawn_command_line_async("gdmflexiserver --startnew", &error)) {
g_warning("Unable to start new session: %s", error->message);
g_error_free(error);
@@ -395,6 +415,8 @@
UserData *user = (UserData *)user_data;
UsersServiceDbus *service = user->service;
+ lock_if_possible();
+
users_service_dbus_activate_user_session (service, user);
}
Follow ups