aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Lane <iain.lane@canonical.com>2013-03-18 13:45:27 +0000
committerIain Lane <iain.lane@canonical.com>2013-03-18 13:45:27 +0000
commita82bb8ab4d50eec7a1cdc3b9b8438834fb22442e (patch)
treefd7f3c881e58fb553522668e72f9811d538409cd
parent139717ed246434a8e32b75453266c8d321d119b7 (diff)
downloadayatana-indicator-datetime-a82bb8ab4d50eec7a1cdc3b9b8438834fb22442e.tar.gz
ayatana-indicator-datetime-a82bb8ab4d50eec7a1cdc3b9b8438834fb22442e.tar.bz2
ayatana-indicator-datetime-a82bb8ab4d50eec7a1cdc3b9b8438834fb22442e.zip
Use NotifyResume from UPower to trigger the clock adjustment on resume
Removes a ConsoleKit dependency.
-rw-r--r--src/datetime-service.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 56ea51c..b0182c9 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -1154,13 +1154,10 @@ static void
session_active_change_cb (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name,
GVariant * parameters, gpointer user_data)
{
- // Just returned from suspend
- if (g_strcmp0(signal_name, "SystemIdleHintChanged") == 0) {
- gboolean idle = FALSE;
- g_variant_get(parameters, "(b)", &idle);
- if (!idle) {
- on_clock_skew ();
- }
+ // Just returned from suspend. Don't care about the sleep type.
+ if (g_strcmp0(signal_name, "NotifyResume") == 0) {
+ g_debug ("System has been resumed; adjusting clock");
+ on_clock_skew ();
}
return;
}
@@ -1174,7 +1171,7 @@ system_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data)
GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error);
if (error != NULL) {
- g_warning("Could not grab DBus proxy for ConsoleKit: %s", error->message);
+ g_warning("Could not grab DBus proxy for UPower: %s", error->message);
g_clear_error (&error);
return;
}
@@ -1482,9 +1479,9 @@ main (int argc, char ** argv)
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
- "org.freedesktop.ConsoleKit",
- "/org/freedesktop/ConsoleKit/Manager",
- "org.freedesktop.ConsoleKit.Manager",
+ "org.freedesktop.UPower",
+ "/org/freedesktop/UPower",
+ "org.freedesktop.UPower",
NULL, system_proxy_cb, dbus);
mainloop = g_main_loop_new(NULL, FALSE);