[gnome-settings-daemon] power: Don't change active state variable in VM



commit cdb55fc928c106346bd14c4badf63c14be803290
Author: Colin Walters <walters verbum org>
Date:   Tue Mar 26 11:35:25 2013 -0400

    power: Don't change active state variable in VM
    
    The intent of the virtual machine detection was to avoid changing
    power states; however, while we avoided some parts of the code, we
    still ended up flipping the state variable to which other parts of the
    code reacted.
    
    With this patch, in a VM, we remain GSD_POWER_IDLE_MODE_NORMAL
    permanently.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696500

 plugins/power/gsd-power-manager.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 73b7214..2c8b6ed 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2474,9 +2474,6 @@ idle_set_mode (GsdPowerManager *manager, GsdPowerIdleMode mode)
                 return;
         }
 
-        manager->priv->current_idle_mode = mode;
-        g_debug ("Doing a state transition: %s", idle_mode_to_string (mode));
-
         /* don't do any power saving if we're a VM */
         if (manager->priv->is_virtual_machine) {
                 g_debug ("ignoring state transition to %s as virtual machine",
@@ -2484,6 +2481,9 @@ idle_set_mode (GsdPowerManager *manager, GsdPowerIdleMode mode)
                 return;
         }
 
+        manager->priv->current_idle_mode = mode;
+        g_debug ("Doing a state transition: %s", idle_mode_to_string (mode));
+
         /* if we're moving to an idle mode, make sure
          * we add a watch to take us back to normal */
         if (mode != GSD_POWER_IDLE_MODE_NORMAL) {


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