aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIain Lane <iain.lane@canonical.com>2013-05-03 19:46:11 +0000
committerTarmac <Unknown>2013-05-03 19:46:11 +0000
commitaac7c2f2cfb886e3c2fc8b042b6eb13f11fc79c2 (patch)
treec76a59e9514fc33610707a49c08e4edf5d3542cb /src
parent0628bfa3e41ddd04bd01e6c337aa598435140014 (diff)
parent271cbd1d1ec1916bb80308908d940d43d7c6d7ee (diff)
downloadayatana-indicator-datetime-aac7c2f2cfb886e3c2fc8b042b6eb13f11fc79c2.tar.gz
ayatana-indicator-datetime-aac7c2f2cfb886e3c2fc8b042b6eb13f11fc79c2.tar.bz2
ayatana-indicator-datetime-aac7c2f2cfb886e3c2fc8b042b6eb13f11fc79c2.zip
Use logind instead of ConsoleKit to adjust the clock upon return from sleep. Fixes: https://bugs.launchpad.net/bugs/1156613.
Approved by Martin Pitt, Mathieu Trudel-Lapierre, PS Jenkins bot.
Diffstat (limited to 'src')
-rw-r--r--src/datetime-service.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 56ea51c..fd77948 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -1154,11 +1154,12 @@ 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) {
+ // Suspending / returning from suspend (true / false)
+ if (g_strcmp0(signal_name, "PrepareForSleep") == 0) {
+ gboolean sleeping = FALSE;
+ g_variant_get (parameters, "(b)", &sleeping);
+ if (!sleeping) {
+ g_debug ("System has been resumed; adjusting clock");
on_clock_skew ();
}
}
@@ -1174,7 +1175,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 logind: %s", error->message);
g_clear_error (&error);
return;
}
@@ -1482,9 +1483,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.login1",
+ "/org/freedesktop/login1",
+ "org.freedesktop.login1.Manager",
NULL, system_proxy_cb, dbus);
mainloop = g_main_loop_new(NULL, FALSE);