summaryrefslogtreecommitdiff
path: root/mate-extra/mate-power-manager/files/mate-power-manager-1.8.0-r1-avoid-levels-is-0-warning.patch
blob: 9bccb5c95354e72688d3b13bb38da1d28c0c99d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);