From ce6001abfc93c8309fd9ece97e0f8783dd64f346 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Wed, 3 Apr 2013 00:09:20 +0400 Subject: Properly round the new brightness value 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 Signed-off-by: Alan Coopersmith --- xbacklight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xbacklight.c') diff --git a/xbacklight.c b/xbacklight.c index 278043f..1d6d987 100644 --- a/xbacklight.c +++ b/xbacklight.c @@ -328,7 +328,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); } -- cgit v1.2.3