From 5fb4a2c286af90788ff10457a395f606387b914e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 23 Jun 2022 12:42:55 +0200 Subject: [PATCH] monitor-config-manager: Fix layout size with scaled mirroring The dimension of the logical monitor layout was not scaled according to the scale, meaning generated mirror monitor configurations were broken. Part-of: --- src/backends/meta-monitor-config-manager.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c index eafc6c6b6..84ea04faa 100644 --- a/src/backends/meta-monitor-config-manager.c +++ b/src/backends/meta-monitor-config-manager.c @@ -1180,6 +1180,7 @@ create_for_switch_config_all_mirror (MetaMonitorConfigManager *config_manager) GList *monitors; GList *l; MetaMonitorsConfig *monitors_config; + int width, height; layout_mode = meta_monitor_manager_get_default_layout_mode (monitor_manager); monitors = meta_monitor_manager_get_monitors (monitor_manager); @@ -1261,13 +1262,17 @@ create_for_switch_config_all_mirror (MetaMonitorConfigManager *config_manager) monitor_configs = g_list_prepend (monitor_configs, create_monitor_config (monitor, mode)); } + scale_logical_monitor_width (layout_mode, best_scale, + common_mode_w, common_mode_h, + &width, &height); + logical_monitor_config = g_new0 (MetaLogicalMonitorConfig, 1); *logical_monitor_config = (MetaLogicalMonitorConfig) { .layout = (MetaRectangle) { .x = 0, .y = 0, - .width = common_mode_w, - .height = common_mode_h + .width = width, + .height = height }, .scale = best_scale, .monitor_configs = monitor_configs