From ae55a4276c29ba7377fbb79a0e451eb9365f6f37 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 9 Apr 2014 14:43:44 +0200 Subject: avoid "levels is 0" warning if no kbd backlight present --- src/gpm-kbd-backlight.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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); -- cgit v1.2.1