diff options
author | Stefan Seyfried <[email protected]> | 2014-04-09 14:43:44 +0200 |
---|---|---|
committer | Stefan Seyfried <[email protected]> | 2014-04-09 14:43:44 +0200 |
commit | 2b3cf01f84204dd5d8204d519e2167b41cda6bc0 (patch) | |
tree | a853d4fa83fe3451b23672803359a9adebecb23d /src/gpm-kbd-backlight.c | |
parent | 8cb168b752f4130e88daefa400bb9bf07cf18227 (diff) | |
download | mate-power-manager-2b3cf01f84204dd5d8204d519e2167b41cda6bc0.tar.bz2 mate-power-manager-2b3cf01f84204dd5d8204d519e2167b41cda6bc0.tar.xz |
avoid "levels is 0" warning if no kbd backlight present
Diffstat (limited to 'src/gpm-kbd-backlight.c')
-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 0ac6801..a439e94 100644 --- a/src/gpm-kbd-backlight.c +++ b/src/gpm-kbd-backlight.c @@ -113,6 +113,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); |