[gnome-settings-daemon] power: update idle config when plugging in or out



commit 2432c72f49f81d0705775e280e9105097a979374
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 11 22:01:12 2013 -0500

    power: update idle config when plugging in or out
    
    The idle configuration depends on the ac/battery status - we
    choose different settings for some things. Therefore, we need
    to refresh the configuration when the battery status changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691002

 plugins/power/gsd-power-manager.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 247fbce..5ea161d 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -3289,6 +3289,14 @@ idle_configure (GsdPowerManager *manager)
         }
 }
 
+static void
+up_client_on_battery_cb (UpClient *client,
+                         GParamSpec *pspec,
+                         GsdPowerManager *manager)
+{
+        idle_configure (manager);
+}
+
 /**
  * @timeout: The new timeout we want to set, in seconds
  **/
@@ -4069,6 +4077,8 @@ gsd_power_manager_start (GsdPowerManager *manager,
                           G_CALLBACK (engine_device_changed_cb), manager);
         g_signal_connect_after (manager->priv->up_client, "changed",
                                 G_CALLBACK (up_client_changed_cb), manager);
+        g_signal_connect (manager->priv->up_client, "notify::on-battery",
+                          G_CALLBACK (up_client_on_battery_cb), manager);
 
         /* connect to UPower for async power operations */
         g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,



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