1
0
Fork 0

color-manager: Move update_all_gamma helper up

Preparation for next commit, no functional change intended.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3742>
(cherry picked from commit 9ed00280f7)
This commit is contained in:
Michel Dänzer 2024-05-22 12:03:54 +02:00 committed by Jonas Ådahl
parent a95b19ebda
commit b359be6ffb

View file

@ -239,6 +239,32 @@ update_devices (MetaColorManager *color_manager)
priv->devices = devices;
}
static void
update_all_gamma (MetaColorManager *color_manager)
{
MetaColorManagerPrivate *priv =
meta_color_manager_get_instance_private (color_manager);
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (priv->backend);
GList *l;
for (l = meta_monitor_manager_get_monitors (monitor_manager); l; l = l->next)
{
MetaMonitor *monitor = META_MONITOR (l->data);
MetaColorDevice *color_device;
color_device = meta_color_manager_get_color_device (color_manager,
monitor);
if (!color_device)
continue;
if (!meta_color_device_is_ready (color_device))
continue;
meta_color_device_update (color_device, priv->temperature);
}
}
static void
on_monitors_changed (MetaMonitorManager *monitor_manager,
MetaColorManager *color_manager)
@ -282,32 +308,6 @@ cd_client_connect_cb (GObject *source_object,
priv->is_ready = TRUE;
}
static void
update_all_gamma (MetaColorManager *color_manager)
{
MetaColorManagerPrivate *priv =
meta_color_manager_get_instance_private (color_manager);
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (priv->backend);
GList *l;
for (l = meta_monitor_manager_get_monitors (monitor_manager); l; l = l->next)
{
MetaMonitor *monitor = META_MONITOR (l->data);
MetaColorDevice *color_device;
color_device = meta_color_manager_get_color_device (color_manager,
monitor);
if (!color_device)
continue;
if (!meta_color_device_is_ready (color_device))
continue;
meta_color_device_update (color_device, priv->temperature);
}
}
static void
update_temperature (MetaColorManager *color_manager)
{