aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-14 21:02:36 -0500
committerTed Gould <ted@canonical.com>2009-09-14 21:02:36 -0500
commit41fd33b07ae4dbef02424b1b9c880995f8e8e112 (patch)
tree60beeea59d8feeeddbe953dccb0e5c82cb9b82be /src
parentc4c208906843e5678e5150e563c23021404cfeff (diff)
downloadayatana-indicator-session-41fd33b07ae4dbef02424b1b9c880995f8e8e112.tar.gz
ayatana-indicator-session-41fd33b07ae4dbef02424b1b9c880995f8e8e112.tar.bz2
ayatana-indicator-session-41fd33b07ae4dbef02424b1b9c880995f8e8e112.zip
Moving lock screen from status to users service.
Diffstat (limited to 'src')
-rw-r--r--src/status-service.c32
-rw-r--r--src/users-service.c32
2 files changed, 32 insertions, 32 deletions
diff --git a/src/status-service.c b/src/status-service.c
index d8f60d4..8ce7962 100644
--- a/src/status-service.c
+++ b/src/status-service.c
@@ -124,33 +124,6 @@ status_update (void) {
return;
}
-/* 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;
-}
-
static void
status_menu_click (DbusmenuMenuitem * mi, gpointer data)
{
@@ -244,11 +217,6 @@ build_menu (gpointer data)
g_debug("Built %s", status_strings[i]);
}
- DbusmenuMenuitem * mi = dbusmenu_menuitem_new();
- dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
- g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), GINT_TO_POINTER(i));
- dbusmenu_menuitem_child_append(root, mi);
-
return FALSE;
}
diff --git a/src/users-service.c b/src/users-service.c
index bc8911b..6c44781 100644
--- a/src/users-service.c
+++ b/src/users-service.c
@@ -107,10 +107,42 @@ activate_new_session (DbusmenuMenuitem * mi, gpointer user_data)
return;
}
+/* 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;
+}
+
static void
create_items (DbusmenuMenuitem * root) {
DbusmenuMenuitem * mi = NULL;
+ mi = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Lock Screen"));
+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(lock_screen), NULL);
+ dbusmenu_menuitem_child_append(root, mi);
+
if (check_guest_session()) {
mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Guest Session"));