summaryrefslogtreecommitdiff
path: root/src/gpm-kbd-backlight.c
diff options
context:
space:
mode:
authorMartin Wimpress <[email protected]>2015-07-28 14:47:01 +0100
committerMartin Wimpress <[email protected]>2015-07-28 14:47:01 +0100
commit0d50ed798d6c52977d557a2d6857a8f4318ccda1 (patch)
treee93e99739802f0097482c08c730cc17d206b99b6 /src/gpm-kbd-backlight.c
parent17f44d0183ab7ac083dc9800b2c44c65f1f789e3 (diff)
parent8352686d856b164432732668afed24f248c17323 (diff)
downloadmate-power-manager-0d50ed798d6c52977d557a2d6857a8f4318ccda1.tar.bz2
mate-power-manager-0d50ed798d6c52977d557a2d6857a8f4318ccda1.tar.xz
Merge pull request #157 from mesouug/master
Unable to change keyboard back light #108
Diffstat (limited to 'src/gpm-kbd-backlight.c')
-rw-r--r--src/gpm-kbd-backlight.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpm-kbd-backlight.c b/src/gpm-kbd-backlight.c
index b3091ac..4221004 100644
--- a/src/gpm-kbd-backlight.c
+++ b/src/gpm-kbd-backlight.c
@@ -121,6 +121,11 @@ gpm_kbd_backlight_set (GpmKbdBacklight *backlight,
goal = gpm_discrete_from_percent (percentage, backlight->priv->max_brightness);
scale = percentage > backlight->priv->brightness_percent ? 1 : -1;
+ /* if percentage change too small force next value */
+ if (goal == backlight->priv->brightness) {
+ goal += percentage == backlight->priv->brightness_percent ? 0 : scale;
+ }
+
/* step loop down by 1 for a dimming effect */
while (backlight->priv->brightness != goal) {
backlight->priv->brightness += scale;