monitor-manager: Derive configured global scale using common value

When deriving the global scale from config, we need to ensure that the value
is matching all the monitor configurations.

If not, we should fallback to the normal scale value.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/407

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/336>
This commit is contained in:
Marco Trevisan (Treviño) 2018-11-29 23:29:08 -05:00
parent 7c87c1c24f
commit 1ab79c79a5

View File

@ -219,11 +219,17 @@ static float
derive_configured_global_scale (MetaMonitorManager *manager, derive_configured_global_scale (MetaMonitorManager *manager,
MetaMonitorsConfig *config) MetaMonitorsConfig *config)
{ {
MetaLogicalMonitorConfig *logical_monitor_config; GList *l;
logical_monitor_config = config->logical_monitor_configs->data; for (l = config->logical_monitor_configs; l; l = l->next)
{
MetaLogicalMonitorConfig *monitor_config = l->data;
return logical_monitor_config->scale; if (is_global_scale_matching_in_config (config, monitor_config->scale))
return monitor_config->scale;
}
return 1.0;
} }
static float static float