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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2479>
This commit is contained in:
Jonas Ådahl 2022-06-23 12:42:55 +02:00 committed by Marge Bot
parent b2ba653dd9
commit 5fb4a2c286

View File

@ -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