aboutsummaryrefslogtreecommitdiff
path: root/src/status-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-07-26 23:45:32 -0500
committerTed Gould <ted@canonical.com>2009-07-26 23:45:32 -0500
commit935037f30000d1dfba4fa2917d7fc0b5c03f6fe8 (patch)
treee213c17bb3c0e403f27de7f90c3ca3badecf8314 /src/status-service.c
parentfe8cb5044f5c599460efb5e221cc4b0e474cad08 (diff)
parent0417e7049a32ceb45e19705992dfccef5d858893 (diff)
downloadayatana-indicator-session-935037f30000d1dfba4fa2917d7fc0b5c03f6fe8.tar.gz
ayatana-indicator-session-935037f30000d1dfba4fa2917d7fc0b5c03f6fe8.tar.bz2
ayatana-indicator-session-935037f30000d1dfba4fa2917d7fc0b5c03f6fe8.zip
* Lock screen works
* Pidgin proxy gets setup and doesn't crash
Diffstat (limited to 'src/status-service.c')
-rw-r--r--src/status-service.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/status-service.c b/src/status-service.c
index e02e70f..dbb597c 100644
--- a/src/status-service.c
+++ b/src/status-service.c
@@ -41,10 +41,30 @@ static const gchar * status_icons[STATUS_PROVIDER_STATUS_LAST] = {
static DbusmenuMenuitem * root_menuitem = NULL;
static GMainLoop * mainloop = NULL;
+/* A fun little function to actually lock the screen. If,
+ that's what you want, let's do it! */
static void
lock_screen (DbusmenuMenuitem * mi, gpointer data)
{
g_debug("Lock Screen");
+
+ DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+ g_return_if_fail(session_bus != NULL);
+
+ DBusGProxy * proxy = dbus_g_proxy_new_for_name_owner(session_bus,
+ "org.gnome.ScreenSaver",
+ "/",
+ "org.gnome.ScreenSaver",
+ NULL);
+ g_return_if_fail(proxy != NULL);
+
+ dbus_g_proxy_call_no_reply(proxy,
+ "Lock",
+ G_TYPE_INVALID,
+ G_TYPE_INVALID);
+
+ g_object_unref(proxy);
+
return;
}