[gnome-power-manager] Treat brightness-up when at max as a success



commit e013cad1a699669fa30b31cadab73533de9f1ce2
Author: Michael Terry <michael terry canonical com>
Date:   Fri Sep 24 09:56:47 2010 -0400

    Treat brightness-up when at max as a success
    
    And similarly for brightness-down when at minimum.
    Fixes GNOME bug 627755.

 src/gpm-brightness.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c
index f623560..dcb87f5 100644
--- a/src/gpm-brightness.c
+++ b/src/gpm-brightness.c
@@ -707,9 +707,13 @@ gpm_brightness_up (GpmBrightness *brightness, gboolean *hw_changed)
 			if (brightness->priv->extension_current > brightness->priv->extension_levels)
 				brightness->priv->extension_current = brightness->priv->extension_levels;
 			ret = gpm_brightness_helper_set_value ("set-brightness", brightness->priv->extension_current);
+			if (hw_changed != NULL)
+				*hw_changed = ret;
+		} else {
+			ret = TRUE;
+			if (hw_changed != NULL)
+				*hw_changed = FALSE;
 		}
-		if (hw_changed != NULL)
-			*hw_changed = ret;
 		brightness->priv->cache_trusted = FALSE;
 		goto out;
 	}
@@ -758,9 +762,13 @@ gpm_brightness_down (GpmBrightness *brightness, gboolean *hw_changed)
 			if (brightness->priv->extension_current < 0)
 				brightness->priv->extension_current = 0;
 			ret = gpm_brightness_helper_set_value ("set-brightness", brightness->priv->extension_current);
+			if (hw_changed != NULL)
+				*hw_changed = ret;
+		} else {
+			ret = TRUE;
+			if (hw_changed != NULL)
+				*hw_changed = FALSE;
 		}
-		if (hw_changed != NULL)
-			*hw_changed = ret;
 		brightness->priv->cache_trusted = FALSE;
 		goto out;
 	}



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