aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-15 20:46:01 -0500
committerTed Gould <ted@gould.cx>2010-03-15 20:46:01 -0500
commit40e7ac045c4c4cb93b71bf532187891f67825ce3 (patch)
treef19e429decff444297ef3ab737c39ae4c4a66833 /src
parent48ee59d301187097e93727dc2fdea1e85efabac8 (diff)
downloadayatana-indicator-session-40e7ac045c4c4cb93b71bf532187891f67825ce3.tar.gz
ayatana-indicator-session-40e7ac045c4c4cb93b71bf532187891f67825ce3.tar.bz2
ayatana-indicator-session-40e7ac045c4c4cb93b71bf532187891f67825ce3.zip
Making a small little wrapper to check the lockdown key.
Diffstat (limited to 'src')
-rw-r--r--src/session-service.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/session-service.c b/src/session-service.c
index 3832e89..020aad3 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -129,6 +129,20 @@ ensure_gconf_client (void)
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 @@ machine_sleep (DbusmenuMenuitem * mi, guint timestamp, gpointer userdata)
}
screensaver_throttle(type);
- lock_screen(NULL, 0, NULL);
+ lock_if_possible();
dbus_g_proxy_begin_call(up_main_proxy,
type,
@@ -341,7 +355,7 @@ activate_guest_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_da
{
GError * error = NULL;
- lock_screen(mi, timestamp, user_data);
+ lock_if_possible();
if (!g_spawn_command_line_async(GUEST_SESSION_LAUNCHER, &error)) {
g_warning("Unable to start guest session: %s", error->message);
@@ -384,7 +398,7 @@ activate_new_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data
{
GError * error = NULL;
- lock_screen(mi, timestamp, user_data);
+ lock_if_possible();
if (!g_spawn_command_line_async("gdmflexiserver --startnew", &error)) {
g_warning("Unable to start new session: %s", error->message);
@@ -401,7 +415,7 @@ activate_user_session (DbusmenuMenuitem *mi, guint timestamp, gpointer user_data
UserData *user = (UserData *)user_data;
UsersServiceDbus *service = user->service;
- lock_screen(mi, timestamp, user_data);
+ lock_if_possible();
users_service_dbus_activate_user_session (service, user);
}