power: Avoid warning with no keyboard backlight
If there's no keyboard backlight interface in gnome-settings-daemon, hide the slider as well, rather than throw a warning. https://bugzilla.gnome.org/show_bug.cgi?id=706040
This commit is contained in:
parent
6fddedad84
commit
f7c5225288
1 changed files with 10 additions and 4 deletions
|
@ -891,10 +891,16 @@ sync_kbd_brightness (CcPowerPanel *self)
|
|||
GtkRange *range;
|
||||
|
||||
result = g_dbus_proxy_get_cached_property (self->priv->kbd_proxy, "Brightness");
|
||||
|
||||
/* set the slider */
|
||||
g_variant_get (result, "i", &brightness);
|
||||
visible = brightness >= 0.0;
|
||||
if (result)
|
||||
{
|
||||
/* set the slider */
|
||||
brightness = g_variant_get_uint32 (result);
|
||||
visible = brightness >= 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
visible = FALSE;
|
||||
}
|
||||
|
||||
gtk_widget_set_visible (self->priv->kbd_brightness_row, visible);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue