[gnome-settings-daemon/docking-stations] Go back to checking for outputs being off, not disconnected



commit 6f21733850f46633bdbe1fdbab792da6fd2b0a32
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Dec 7 11:36:09 2011 -0600

    Go back to checking for outputs being off, not disconnected
    
    The xrandr plugin makes the decision of whether to turn displays on and off,
    depending on whether they are connected and whether the laptop's lid is
    closed.  So, we'll base *our* decision on that one - whether displays
    are off - to see if we should suspend the machine.
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 plugins/power/gsd-power-manager.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 3b0e834..ad1aa11 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2104,12 +2104,12 @@ is_laptop (GnomeRRScreen *screen, GnomeRROutputInfo *output)
 }
 
 static gboolean
-non_laptop_outputs_are_all_disconnected (GnomeRRScreen *screen)
+non_laptop_outputs_are_all_off (GnomeRRScreen *screen)
 {
         GnomeRRConfig *config;
         GnomeRROutputInfo **outputs;
         int i;
-        gboolean all_disco;
+        gboolean all_off;
 
         config = gnome_rr_config_new_current (screen, NULL); /* NULL-GError */
         if (!config)
@@ -2120,17 +2120,17 @@ non_laptop_outputs_are_all_disconnected (GnomeRRScreen *screen)
                 if (is_laptop (screen, outputs[i]))
                         continue;
 
-                if (gnome_rr_output_info_is_connected (outputs[i])) {
-                        all_disco = FALSE;
+                if (gnome_rr_output_info_is_active (outputs[i])) {
+                        all_off = FALSE;
                         goto out;
                 }
         }
 
-        all_disco = TRUE;
+        all_off = TRUE;
 
 out:
         g_object_unref (config);
-        return all_disco;
+        return all_off;
 }
 
 static void
@@ -2177,11 +2177,11 @@ do_lid_closed_action (GsdPowerManager *manager)
         }
 
         /* perform policy action */
-        if (non_laptop_outputs_are_all_disconnected (manager->priv->x11_screen)) {
+        if (non_laptop_outputs_are_all_off (manager->priv->x11_screen)) {
                 g_debug ("lid is closed; suspending or hibernating");
                 do_power_action_type (manager, action_type);
         } else
-                g_debug ("lid is closed; not suspending nor hibernating since some external monitor outputs are still connected");
+                g_debug ("lid is closed; not suspending nor hibernating since some external monitor outputs are still active");
 }
 
 



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