From 1ab79c79a5290dc5034f0835bfe3252278710e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 29 Nov 2018 23:29:08 -0500 Subject: [PATCH] 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: --- src/backends/meta-monitor-manager.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 71ff8a2a3..1d42cad21 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -219,11 +219,17 @@ static float derive_configured_global_scale (MetaMonitorManager *manager, 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