aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-08 10:50:28 -0600
committerTed Gould <ted@gould.cx>2010-02-08 10:50:28 -0600
commitc0ed8e804bd870de8a941bf4d654e7ce90da20c8 (patch)
tree9165ec54237e1a64a750dc24c32fd5af969bac5d
parente9698bb4739ec4894736037234e93d4ce0e06623 (diff)
parent751fbe8b0f5c049abdaa007b104772691305e21f (diff)
downloadayatana-indicator-session-c0ed8e804bd870de8a941bf4d654e7ce90da20c8.tar.gz
ayatana-indicator-session-c0ed8e804bd870de8a941bf4d654e7ce90da20c8.tar.bz2
ayatana-indicator-session-c0ed8e804bd870de8a941bf4d654e7ce90da20c8.zip
* Upstream Merge
* Building the GSS proxy when it's needed, not at startup.
-rw-r--r--debian/changelog7
-rw-r--r--src/lock-helper.c34
2 files changed, 29 insertions, 12 deletions
diff --git a/debian/changelog b/debian/changelog
index 6e2a31a..b6e7850 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+indicator-session (0.2.1-0ubuntu1~ppa2) UNRELEASED; urgency=low
+
+ * Upstream Merge
+ * Building the GSS proxy when it's needed, not at startup.
+
+ -- Ted Gould <ted@ubuntu.com> Mon, 08 Feb 2010 10:50:13 -0600
+
indicator-session (0.2.1-0ubuntu1~ppa1) lucid; urgency=low
* Upstream release 0.2.1
diff --git a/src/lock-helper.c b/src/lock-helper.c
index f9c46cc..94a86ef 100644
--- a/src/lock-helper.c
+++ b/src/lock-helper.c
@@ -35,6 +35,8 @@ static gboolean is_guest = FALSE;
static gdm_autologin_cb_t gdm_autologin_cb = NULL;
+void build_gss_proxy (void);
+
/* Checks to see if there is an error and reports
it. Not much else we can do. */
static void
@@ -56,6 +58,9 @@ screensaver_unthrottle (void)
{
g_return_if_fail(cookie != 0);
+ build_gss_proxy();
+ g_return_if_fail(gss_proxy != NULL);
+
dbus_g_proxy_begin_call(gss_proxy, "UnThrottle",
unthrottle_return, NULL,
NULL,
@@ -103,6 +108,9 @@ screensaver_throttle (gchar * reason)
screensaver_unthrottle();
}
+ build_gss_proxy();
+ g_return_if_fail(gss_proxy != NULL);
+
cookie_call = dbus_g_proxy_begin_call(gss_proxy, "Throttle",
throttle_return, NULL,
NULL,
@@ -247,17 +255,19 @@ gss_active_changed (DBusGProxy * proxy, gboolean active, gpointer data)
void
build_gss_proxy (void)
{
- DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
- g_return_if_fail(session_bus != NULL);
-
- gss_proxy = dbus_g_proxy_new_for_name(session_bus,
- "org.gnome.ScreenSaver",
- "/",
- "org.gnome.ScreenSaver");
- g_return_if_fail(gss_proxy != NULL);
-
- dbus_g_proxy_add_signal(gss_proxy, "ActiveChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID);
- dbus_g_proxy_connect_signal(gss_proxy, "ActiveChanged", G_CALLBACK(gss_active_changed), NULL, NULL);
+ if (gss_proxy == NULL) {
+ DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+ g_return_if_fail(session_bus != NULL);
+
+ gss_proxy = dbus_g_proxy_new_for_name(session_bus,
+ "org.gnome.ScreenSaver",
+ "/",
+ "org.gnome.ScreenSaver");
+ g_return_if_fail(gss_proxy != NULL);
+
+ dbus_g_proxy_add_signal(gss_proxy, "ActiveChanged", G_TYPE_BOOLEAN, G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal(gss_proxy, "ActiveChanged", G_CALLBACK(gss_active_changed), NULL, NULL);
+ }
return;
}
@@ -288,6 +298,7 @@ lock_screen (DbusmenuMenuitem * mi, guint timestamp, gpointer data)
return;
}
+ build_gss_proxy();
g_return_if_fail(gss_proxy != NULL);
dbus_g_proxy_call_no_reply(gss_proxy,
@@ -320,7 +331,6 @@ lock_screen_setup (gpointer data)
}
build_gdm_proxy();
- build_gss_proxy();
return FALSE;
}