gnome-power-manager r3142 - in trunk: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-power-manager r3142 - in trunk: . src
- Date: Fri, 2 Jan 2009 09:28:52 +0000 (UTC)
Author: rhughes
Date: Fri Jan 2 09:28:52 2009
New Revision: 3142
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3142&view=rev
Log:
2009-01-02 Richard Hughes <richard hughsie com>
* src/gpm-brightness-xrandr.c: (gpm_brightness_xrandr_output_set):
Don't step through each brightness state when we fade modes, some
devices using XRandR have an insane number of steps. Use the step
value we calculated for the _up and _down logic.
Fixes #566095
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 Fri Jan 2 09:28:52 2009
@@ -301,6 +301,7 @@
guint min, max;
gint i;
gint shared_value_abs;
+ guint step;
g_return_val_if_fail (GPM_IS_BRIGHTNESS_XRANDR (brightness), FALSE);
@@ -326,8 +327,13 @@
/* step the correct way */
if (cur < shared_value_abs) {
+
+ /* some adaptors have a large number of steps */
+ step = gpm_brightness_get_step (shared_value_abs - cur);
+ egg_debug ("using step of %i", step);
+
/* going up */
- for (i=cur; i<=shared_value_abs; i++) {
+ for (i=cur; i<=shared_value_abs; i+=step) {
ret = gpm_brightness_xrandr_output_set_internal (brightness, output, i);
if (!ret)
break;
@@ -335,8 +341,13 @@
g_usleep (1000 * GPM_BRIGHTNESS_DIM_INTERVAL);
}
} else {
+
+ /* some adaptors have a large number of steps */
+ step = gpm_brightness_get_step (cur - shared_value_abs);
+ egg_debug ("using step of %i", step);
+
/* going down */
- for (i=cur; i>=shared_value_abs; i--) {
+ for (i=cur; i>=shared_value_abs; i-=step) {
ret = gpm_brightness_xrandr_output_set_internal (brightness, output, i);
if (!ret)
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]