From c3263133704174eb1166b5f3d27abd0c17bc3a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 30 Jul 2021 14:12:40 +0200 Subject: [PATCH] monitor-config-manager: Find builtin configuration even when inactive When creating the configuration for the builtin monitor we try to get the panel configuration for the builtin panel, but we don't proceed if that monitor is currently inactive. This is fine when adjusting an active configuration to the current device rotation, but it isn't correct when we want to create a new configuration based on another where the monitor is configured but not yet enabled. So, only find the panel configuration without looking the current state but ensuring that the passed configuration will enable it. Part-of: --- src/backends/meta-monitor-config-manager.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c index 0a895c0a5..341ca155f 100644 --- a/src/backends/meta-monitor-config-manager.c +++ b/src/backends/meta-monitor-config-manager.c @@ -1007,7 +1007,7 @@ find_logical_config_for_builtin_display_rotation (MetaMonitorConfigManager *conf GList *l; panel = meta_monitor_manager_get_laptop_panel (config_manager->monitor_manager); - if (panel && meta_monitor_is_active (panel)) + if (panel) { for (l = logical_monitor_configs; l; l = l->next) { @@ -1022,7 +1022,14 @@ find_logical_config_for_builtin_display_rotation (MetaMonitorConfigManager *conf monitor_config = logical_monitor_config->monitor_configs->data; if (meta_monitor_spec_equals (meta_monitor_get_spec (panel), monitor_config->monitor_spec)) - return logical_monitor_config; + { + MetaMonitorMode *mode; + + mode = meta_monitor_get_mode_from_spec (panel, + monitor_config->mode_spec); + if (mode) + return logical_monitor_config; + } } }