gnome-power-manager r3195 - in trunk: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r3195 - in trunk: . src
- Date: Wed, 28 Jan 2009 08:44:18 +0000 (UTC)
Author: rhughes
Date: Wed Jan 28 08:44:18 2009
New Revision: 3195
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3195&view=rev
Log:
2009-01-28 Richard Hughes <richard hughsie com>
* src/gpm-brightness-xrandr.c: (gpm_brightness_xrandr_output_down):
When the minimum reported brightness is not zero don't wraparound 0
when we try to step down a large number of brightness levels.
Instead truncate to the minimum to fix a hang.
Fixes #569100
Patch from Fortunato Ventre, many thanks.
Modified:
trunk/ChangeLog
trunk/src/gpm-brightness-xrandr.c
Modified: trunk/src/gpm-brightness-xrandr.c
==============================================================================
--- trunk/src/gpm-brightness-xrandr.c (original)
+++ trunk/src/gpm-brightness-xrandr.c Wed Jan 28 08:44:18 2009
@@ -232,6 +232,7 @@
gpm_brightness_xrandr_output_down (GpmBrightnessXRandR *brightness, RROutput output)
{
guint cur;
+ guint step;
gboolean ret;
guint min, max;
@@ -248,10 +249,12 @@
egg_debug ("already min");
return TRUE;
}
- cur -= gpm_brightness_get_step ((max-min)+1);
- if (cur < min) {
+ step = gpm_brightness_get_step ((max-min)+1);
+ if (cur < step) {
egg_debug ("truncating to %i", min);
cur = min;
+ } else {
+ cur -= step;
}
ret = gpm_brightness_xrandr_output_set_internal (brightness, output, cur);
return ret;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]