[gnome-settings-daemon] power: Work-around the lack of DPMS support in Xorg dummy



commit 0af13c2125cc0ca5eeda8975af3c68d3f5c746e3
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jan 29 14:41:25 2013 +0100

    power: Work-around the lack of DPMS support in Xorg dummy

 plugins/power/gsd-power-manager.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 3bac636..687ee25 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2002,16 +2002,21 @@ backlight_enable (GsdPowerManager *manager)
 static void
 backlight_disable (GsdPowerManager *manager)
 {
-        GnomeRRDpmsMode mode;
         gboolean ret;
         GError *error = NULL;
 
         /* Save the backlight, if DPMS isn't on yet, so we can capture it */
+#ifndef GSD_MOCK
+        GnomeRRDpmsMode mode;
+
         if (manager->priv->backlight_available &&
             gnome_rr_screen_get_dpms_mode (manager->priv->rr_screen, &mode, NULL) &&
             mode == GNOME_RR_DPMS_ON) {
                 manager->priv->pre_dpms_brightness = backlight_get_abs (manager->priv->rr_screen, NULL);
         }
+#else
+        manager->priv->pre_dpms_brightness = backlight_get_abs (manager->priv->rr_screen, NULL);
+#endif /* GSD_MOCK */
         if (manager->priv->pre_dpms_brightness != -1)
                 backlight_set_abs (manager->priv->rr_screen, backlight_get_min (manager->priv->rr_screen), NULL);
 



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