[PATCH xbacklight 1/2] Properly round the new brightness value

Роман Донченко dpb at corrigendum.ru
Mon Apr 22 15:00:52 PDT 2013


Ping?

Roman Donchenko <dpb at corrigendum.ru> писал в своём письме Wed, 03 Apr 2013  
00:09:20 +0400:

> Previously, it was always rounded down, which meant that -dec X would
> result in a bigger change than -inc X for the same X if rounding took  
> place.
>
> Signed-off-by: Roman Donchenko <dpb at corrigendum.ru>
> ---
>  xbacklight.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xbacklight.c b/xbacklight.c
> index 2189095..c054d26 100644
> --- a/xbacklight.c
> +++ b/xbacklight.c
> @@ -309,7 +309,7 @@ main (int argc, char **argv)
>  				cur = new;
>  			    else
>  				cur += step;
> -			    backlight_set (conn, output, (long) cur);
> +			    backlight_set (conn, output, (long) (cur + 0.5));
>  			    xcb_flush (conn);
>  			    usleep (total_time * 1000 / steps);
>  			}


More information about the xorg-devel mailing list