diff options
author | Roman Donchenko <dpb@corrigendum.ru> | 2013-04-03 00:09:20 +0400 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-06-09 13:05:47 -0700 |
commit | ce6001abfc93c8309fd9ece97e0f8783dd64f346 (patch) | |
tree | 07fd90d536d4fe4a75e1d0e9020f6756735505c7 /xbacklight.c | |
parent | 31d4c5d6c10d1547d0031a36ed7c57b78d048fea (diff) |
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 <dpb@corrigendum.ru>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xbacklight.c')
-rw-r--r-- | xbacklight.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |