[gnome-power-manager/gnome-3-0] gpm-idle: manually update the status property



commit 44503c5bca065290ce73b0d064a1a0db7de2936d
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon May 2 19:18:58 2011 -0400

    gpm-idle: manually update the status property
    
    gnome-session doesn't emit PropertyChanged since it uses dbus-glib,
    therefore we need to manually update the cached property when
    receiving a SessionChanged signal.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=679083
    
    Signed-off-by: Richard Hughes <richard hughsie com>

 src/gpm-idle.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/gpm-idle.c b/src/gpm-idle.c
index 04225fc..0f2f1ee 100644
--- a/src/gpm-idle.c
+++ b/src/gpm-idle.c
@@ -424,6 +424,11 @@ gpm_idle_dbus_signal_cb (GDBusProxy *proxy, const gchar *sender_name, const gcha
 		return;
 	}
 	if (g_strcmp0 (signal_name, "StatusChanged") == 0) {
+                guint status;
+
+                g_variant_get (parameters, "(u)", &status);
+                g_dbus_proxy_set_cached_property (proxy, "status",
+                                                  g_variant_new ("u", status));
 		g_debug ("Received gnome session status change");
 		gpm_idle_evaluate (idle);
 		return;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]