From 4920b5064d2240c2d202deeb92a8ad09780a5799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 26 Feb 2020 16:42:21 +0100 Subject: [PATCH] tests/monitor-unit-tests: Only set suggested_x/y when relevant It's used for two things: avoid reading configs, and actual hotplug update mode. The former requires the suggested position to be (-1, -1) to trick the monitor configuration generator to skip using the suggested position even if hotplug update mode is set to TRUE. The latter should use the actual hotplug mode coordinates. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1287 --- src/tests/monitor-test-utils.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/tests/monitor-test-utils.c b/src/tests/monitor-test-utils.c index b799e6adc..3743a39a9 100644 --- a/src/tests/monitor-test-utils.c +++ b/src/tests/monitor-test-utils.c @@ -543,12 +543,6 @@ create_monitor_test_setup (MonitorTestCaseSetup *setup, int i; int n_laptop_panels = 0; int n_normal_panels = 0; - gboolean hotplug_mode_update; - - if (flags & MONITOR_TEST_FLAG_NO_STORED) - hotplug_mode_update = TRUE; - else - hotplug_mode_update = FALSE; test_setup = g_new0 (MetaMonitorTestSetup, 1); @@ -659,15 +653,16 @@ create_monitor_test_setup (MonitorTestCaseSetup *setup, output_info->serial = g_strdup (serial); if (setup->outputs[i].hotplug_mode) { + output_info->hotplug_mode_update = TRUE; output_info->suggested_x = setup->outputs[i].suggested_x; output_info->suggested_y = setup->outputs[i].suggested_y; } - else + else if (flags & MONITOR_TEST_FLAG_NO_STORED) { + output_info->hotplug_mode_update = TRUE; output_info->suggested_x = -1; output_info->suggested_y = -1; } - output_info->hotplug_mode_update = hotplug_mode_update; output_info->width_mm = setup->outputs[i].width_mm; output_info->height_mm = setup->outputs[i].height_mm; output_info->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;