[Xfce4-commits] <xfce4-power-manager:master> And another dpms compilation problem.

Nick Schermer noreply at xfce.org
Thu Apr 19 23:40:01 CEST 2012


Updating branch refs/heads/master
         to 2037614c33008045dda64a8ab1d04b779e504a33 (commit)
       from 2fc3c9d296280b4f630c8b593e261eea5afcb002 (commit)

commit 2037614c33008045dda64a8ab1d04b779e504a33
Author: Nick Schermer <nick at xfce.org>
Date:   Thu Apr 19 23:38:22 2012 +0200

    And another dpms compilation problem.

 settings/xfpm-settings.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/settings/xfpm-settings.c b/settings/xfpm-settings.c
index 8770b04..5275247 100644
--- a/settings/xfpm-settings.c
+++ b/settings/xfpm-settings.c
@@ -614,8 +614,9 @@ format_brightness_value_cb (GtkScale *scale, gdouble value, gpointer data)
 void
 brightness_on_battery_value_changed_cb (GtkWidget *w, XfconfChannel *channel)
 {
-    gint dpms_sleep = (gint) gtk_range_get_value (GTK_RANGE (on_battery_dpms_sleep) );
     gint value    = (gint)gtk_range_get_value (GTK_RANGE (w));
+#ifdef HAVE_DPMS
+    gint dpms_sleep = (gint) gtk_range_get_value (GTK_RANGE (on_battery_dpms_sleep) );
 
     if ( value != BRIGHTNESS_DISABLED )
     {
@@ -624,6 +625,7 @@ brightness_on_battery_value_changed_cb (GtkWidget *w, XfconfChannel *channel)
 	    gtk_range_set_value (GTK_RANGE (on_battery_dpms_sleep), (value / 60) + 1);
 	}
     }
+#endif
     
     if (!xfconf_channel_set_uint (channel, PROPERTIES_PREFIX BRIGHTNESS_ON_BATTERY, value))
     {
@@ -634,8 +636,9 @@ brightness_on_battery_value_changed_cb (GtkWidget *w, XfconfChannel *channel)
 void
 brightness_on_ac_value_changed_cb (GtkWidget *w, XfconfChannel *channel)
 {
-    gint dpms_sleep = (gint) gtk_range_get_value (GTK_RANGE (on_ac_dpms_sleep) );
     gint value    = (gint)gtk_range_get_value (GTK_RANGE (w));
+#ifdef HAVE_DPMS
+    gint dpms_sleep = (gint) gtk_range_get_value (GTK_RANGE (on_ac_dpms_sleep) );
 
     if ( value != BRIGHTNESS_DISABLED )
     {
@@ -644,7 +647,7 @@ brightness_on_ac_value_changed_cb (GtkWidget *w, XfconfChannel *channel)
 	    gtk_range_set_value (GTK_RANGE (on_ac_dpms_sleep), (value / 60) + 1);
 	}
     }
-
+#endif
     if (!xfconf_channel_set_uint (channel, PROPERTIES_PREFIX BRIGHTNESS_ON_AC, value))
     {
 	g_critical ("Cannot set value for property %s\n", BRIGHTNESS_ON_AC);


More information about the Xfce4-commits mailing list