diff options
author | Stefan Seyfried <[email protected]> | 2014-04-09 14:43:44 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2014-09-26 13:48:48 +0200 |
commit | ae55a4276c29ba7377fbb79a0e451eb9365f6f37 (patch) | |
tree | 4069034d5f64db645a17953d566a31d8f85e870b | |
parent | 079471200ad1b05952ea1bef5c65979f552134b6 (diff) | |
download | mate-power-manager-ae55a4276c29ba7377fbb79a0e451eb9365f6f37.tar.bz2 mate-power-manager-ae55a4276c29ba7377fbb79a0e451eb9365f6f37.tar.xz |
avoid "levels is 0" warning if no kbd backlight present
-rw-r--r-- | src/gpm-kbd-backlight.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gpm-kbd-backlight.c b/src/gpm-kbd-backlight.c index 98a64da..af3c131 100644 --- a/src/gpm-kbd-backlight.c +++ b/src/gpm-kbd-backlight.c @@ -128,6 +128,9 @@ gpm_kbd_backlight_set (GpmKbdBacklight *backlight, guint goal; g_return_val_if_fail (GPM_IS_KBD_BACKLIGHT (backlight), FALSE); + /* avoid warnings if no keyboard brightness is available */ + if (backlight->priv->max_brightness < 1) + return FALSE; /* if we're setting the same we are, don't bother */ //g_return_val_if_fail (backlight->priv->brightness_percent != percentage, FALSE); |