diff --git a/src/backends/meta-color-device.c b/src/backends/meta-color-device.c index 5192a7b1f..3bfe776a2 100644 --- a/src/backends/meta-color-device.c +++ b/src/backends/meta-color-device.c @@ -1087,8 +1087,8 @@ meta_color_device_get_assigned_profile (MetaColorDevice *color_device) } void -meta_color_device_update_gamma (MetaColorDevice *color_device, - unsigned int temperature) +meta_color_device_update (MetaColorDevice *color_device, + unsigned int temperature) { MetaColorProfile *color_profile; MetaMonitor *monitor; @@ -1111,6 +1111,22 @@ meta_color_device_update_gamma (MetaColorDevice *color_device, meta_color_profile_get_id (color_profile), temperature); + if (meta_monitor_is_laptop_panel (monitor)) + { + const char *brightness_profile; + + brightness_profile = + meta_color_profile_get_brightness_profile (color_profile); + if (brightness_profile) + { + meta_topic (META_DEBUG_COLOR, + "Setting brightness to %s%% from brightness profile", + brightness_profile); + meta_color_manager_set_brightness (color_device->color_manager, + atoi (brightness_profile)); + } + } + lut_size = meta_monitor_get_gamma_lut_size (monitor); lut = meta_color_profile_generate_gamma_lut (color_profile, temperature, diff --git a/src/backends/meta-color-device.h b/src/backends/meta-color-device.h index 450513e51..bbf2cea6d 100644 --- a/src/backends/meta-color-device.h +++ b/src/backends/meta-color-device.h @@ -62,7 +62,7 @@ MetaColorProfile * meta_color_device_generate_profile_finish (MetaColorDevice * META_EXPORT_TEST gboolean meta_color_device_is_ready (MetaColorDevice *color_device); -void meta_color_device_update_gamma (MetaColorDevice *color_device, - unsigned int temperature); +void meta_color_device_update (MetaColorDevice *color_device, + unsigned int temperature); #endif /* META_COLOR_DEVICE_H */ diff --git a/src/backends/meta-color-manager.c b/src/backends/meta-color-manager.c index 94d06b3ed..6702e34ff 100644 --- a/src/backends/meta-color-manager.c +++ b/src/backends/meta-color-manager.c @@ -109,7 +109,7 @@ on_device_ready (MetaColorDevice *color_device, return; } - meta_color_device_update_gamma (color_device, priv->temperature); + meta_color_device_update (color_device, priv->temperature); } static void @@ -119,7 +119,7 @@ on_device_changed (MetaColorDevice *color_device, MetaColorManagerPrivate *priv = meta_color_manager_get_instance_private (color_manager); - meta_color_device_update_gamma (color_device, priv->temperature); + meta_color_device_update (color_device, priv->temperature); } static char * @@ -282,7 +282,7 @@ update_all_gamma (MetaColorManager *color_manager) if (!meta_color_device_is_ready (color_device)) continue; - meta_color_device_update_gamma (color_device, priv->temperature); + meta_color_device_update (color_device, priv->temperature); } }