[mutter] monitor-manager: Derive configured global scale using common value



commit 1ab79c79a5290dc5034f0835bfe3252278710e7c
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Thu Nov 29 23:29:08 2018 -0500

    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>

 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 71ff8a2a3a..1d42cad210 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]