[gnome-settings-daemon] power: Ignore DBus requests while stopped



commit da8d514e91ce1b95960d3a6242598b0045455aff
Author: Michael Terry <michael terry canonical com>
Date:   Wed Apr 25 17:16:37 2012 -0400

    power: Ignore DBus requests while stopped
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674829

 plugins/power/gsd-power-manager.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 1d60723..5986a80 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -4123,6 +4123,12 @@ handle_method_call (GDBusConnection       *connection,
 {
         GsdPowerManager *manager = GSD_POWER_MANAGER (user_data);
 
+        /* Check session pointer as a proxy for whether the manager is in the
+           start or stop state */
+        if (manager->priv->session == NULL) {
+                return;
+        }
+
         g_debug ("Calling method '%s.%s' for Power",
                  interface_name, method_name);
 
@@ -4157,6 +4163,12 @@ handle_get_property (GDBusConnection *connection,
         GsdPowerManager *manager = GSD_POWER_MANAGER (user_data);
         GVariant *retval = NULL;
 
+        /* Check session pointer as a proxy for whether the manager is in the
+           start or stop state */
+        if (manager->priv->session == NULL) {
+                return NULL;
+        }
+
         if (g_strcmp0 (property_name, "Icon") == 0) {
                 retval = engine_get_icon_property_variant (manager);
         } else if (g_strcmp0 (property_name, "Tooltip") == 0) {



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