diff options
author | Ted Gould <ted@gould.cx> | 2010-08-06 10:57:11 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-08-06 10:57:11 -0500 |
commit | 306e8f6cc860bdbadabe924dc4384c822e49bab9 (patch) | |
tree | b9564d2b2386f313866822e34c5a3b6207e7499c /src/lock-helper.c | |
parent | e86e25a79fbedda83e81e07afd3d0981cf1db44b (diff) | |
download | ayatana-indicator-session-306e8f6cc860bdbadabe924dc4384c822e49bab9.tar.gz ayatana-indicator-session-306e8f6cc860bdbadabe924dc4384c822e49bab9.tar.bz2 ayatana-indicator-session-306e8f6cc860bdbadabe924dc4384c822e49bab9.zip |
Making it so that lock_screen always locks the screen
Diffstat (limited to 'src/lock-helper.c')
-rw-r--r-- | src/lock-helper.c | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/src/lock-helper.c b/src/lock-helper.c index cdc8d14..9b15070 100644 --- a/src/lock-helper.c +++ b/src/lock-helper.c @@ -176,9 +176,11 @@ build_gss_proxy (void) static gboolean activate_timeout (gpointer data) { + /* Clear the ID for the timeout */ guint * address = (guint *)data; *address = 0; + /* Quit the mainloop */ if (gss_mainloop != NULL) { g_main_loop_quit(gss_mainloop); } @@ -186,22 +188,6 @@ activate_timeout (gpointer data) return FALSE; } -/* Handle errors from activating the screensaver */ -static void -active_cb (DBusGProxy * proxy, DBusGProxyCall * call, gpointer user_data) -{ - GError * error = NULL; - - dbus_g_proxy_end_call(proxy, call, &error, G_TYPE_INVALID); - - if (error != NULL) { - g_warning("Unable to activate screensaver: %s", error->message); - g_error_free(error); - } - - return; -} - /* A fun little function to actually lock the screen. If, that's what you want, let's do it! */ void @@ -212,19 +198,10 @@ lock_screen (DbusmenuMenuitem * mi, guint timestamp, gpointer data) build_gss_proxy(); g_return_if_fail(gss_proxy != NULL); - if (will_lock_screen()) { - dbus_g_proxy_call_no_reply(gss_proxy, - "Lock", - G_TYPE_INVALID, - G_TYPE_INVALID); - } else { - dbus_g_proxy_begin_call(gss_proxy, - "SetActive", - active_cb, NULL, - NULL, - G_TYPE_BOOLEAN, TRUE, - G_TYPE_INVALID); - } + dbus_g_proxy_call_no_reply(gss_proxy, + "Lock", + G_TYPE_INVALID, + G_TYPE_INVALID); if (gss_mainloop == NULL) { gss_mainloop = g_main_loop_new(NULL, FALSE); |