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



commit f17f67c71b507d5643381c35a09263849987fa71
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 a2771e5..2f85f0b 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2477,9 +2477,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",
@@ -2487,6 +2484,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]