color-device: Get temperature from the manager

Instead of passing it to the update function. This decouples the
updating from being specifically about the temperature/white point.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3904>
This commit is contained in:
Sebastian Wick
2024-07-16 19:44:45 +02:00
parent 682ce3222c
commit 8eeec32c90
4 changed files with 21 additions and 14 deletions

View File

@ -1226,12 +1226,13 @@ meta_color_device_get_assigned_profile (MetaColorDevice *color_device)
}
void
meta_color_device_update (MetaColorDevice *color_device,
unsigned int temperature)
meta_color_device_update (MetaColorDevice *color_device)
{
MetaColorManager *color_manager = color_device->color_manager;
MetaColorProfile *color_profile;
MetaMonitor *monitor;
size_t lut_size;
unsigned int temperature;
color_profile = meta_color_device_get_assigned_profile (color_device);
if (!color_profile)
@ -1241,6 +1242,8 @@ meta_color_device_update (MetaColorDevice *color_device,
if (!meta_monitor_is_active (monitor))
return;
temperature = meta_color_manager_get_temperature (color_manager);
meta_topic (META_DEBUG_COLOR,
"Updating device '%s' (%s) using color profile '%s' "
"and temperature %uK",
@ -1260,7 +1263,7 @@ meta_color_device_update (MetaColorDevice *color_device,
meta_topic (META_DEBUG_COLOR,
"Setting brightness to %s%% from brightness profile",
brightness_profile);
meta_color_manager_set_brightness (color_device->color_manager,
meta_color_manager_set_brightness (color_manager,
atoi (brightness_profile));
}
}