aboutsummaryrefslogtreecommitdiff
path: root/src/session-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-09-24 09:15:58 -0500
committerTed Gould <ted@canonical.com>2009-09-24 09:15:58 -0500
commit1adc4260f5ae9de44f2b0376bb3f55381479d76a (patch)
tree52fa3216059c753ddf22a60257a2663eca6156a8 /src/session-service.c
parent159f4132b82d6a3b152fb8164dc5b4b6d76696da (diff)
downloadayatana-indicator-session-1adc4260f5ae9de44f2b0376bb3f55381479d76a.tar.gz
ayatana-indicator-session-1adc4260f5ae9de44f2b0376bb3f55381479d76a.tar.bz2
ayatana-indicator-session-1adc4260f5ae9de44f2b0376bb3f55381479d76a.zip
Putting in the infrastructure to have GDM settings proxy
Diffstat (limited to 'src/session-service.c')
-rw-r--r--src/session-service.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/session-service.c b/src/session-service.c
index fafcbb1..3041517 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -44,6 +44,9 @@ static GMainLoop * mainloop = NULL;
static DBusGProxy * dkp_main_proxy = NULL;
static DBusGProxy * dkp_prop_proxy = NULL;
+static DBusGProxy * gdm_settings_proxy = NULL;
+static gboolean gdm_auto_login = FALSE;
+
static DBusGProxyCall * suspend_call = NULL;
static DBusGProxyCall * hibernate_call = NULL;
@@ -53,12 +56,26 @@ static DbusmenuMenuitem * logout_mi = NULL;
static DbusmenuMenuitem * restart_mi = NULL;
static DbusmenuMenuitem * shutdown_mi = NULL;
+/* Sets up the proxy and queries for the setting to know
+ whether we're doing an autologin. */
+static gboolean
+build_gdm_proxy (gpointer null_data)
+{
+ gdm_settings_proxy = NULL;
+
+ return FALSE;
+}
+
/* A fun little function to actually lock the screen. If,
that's what you want, let's do it! */
static void
lock_screen (void)
{
g_debug("Lock Screen");
+ if (gdm_auto_login) {
+ g_debug("\tGDM set to autologin, blocking lock");
+ return;
+ }
DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
g_return_if_fail(session_bus != NULL);
@@ -333,6 +350,8 @@ main (int argc, char ** argv)
return 1;
}
+ g_idle_add(build_gdm_proxy, NULL);
+
root_menuitem = dbusmenu_menuitem_new();
g_debug("Root ID: %d", dbusmenu_menuitem_get_id(root_menuitem));