From 65d3e479875348978d0137e9913f19fa8b0174d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 11 Oct 2017 17:55:50 +0800 Subject: [PATCH] settings: Get UI scaling factor from primary logical monitor Don't use MAX(logical monitor scales) to determine the UI scaling factor, just use the primary logical monitor. That's where the shell UI will most likely be. https://bugzilla.gnome.org/show_bug.cgi?id=788820 --- src/backends/meta-settings.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/backends/meta-settings.c b/src/backends/meta-settings.c index cf66334f1..73741fd5a 100644 --- a/src/backends/meta-settings.c +++ b/src/backends/meta-settings.c @@ -67,23 +67,14 @@ calculate_ui_scaling_factor (MetaSettings *settings) { MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (settings->backend); - GList *logical_monitors; - GList *l; - float max_scale = 1.0; + MetaLogicalMonitor *primary_logical_monitor; - logical_monitors = - meta_monitor_manager_get_logical_monitors (monitor_manager); - for (l = logical_monitors; l; l = l->next) - { - MetaLogicalMonitor *logical_monitor = l->data; + primary_logical_monitor = + meta_monitor_manager_get_primary_logical_monitor (monitor_manager); + if (!primary_logical_monitor) + return 1; - max_scale = MAX (meta_logical_monitor_get_scale (logical_monitor), - max_scale); - } - - g_warn_if_fail (fmodf (max_scale, 1.0) == 0.0); - - return (int) max_scale; + return (int) meta_logical_monitor_get_scale (primary_logical_monitor); } static gboolean