monitor-manager/dummy: Make modes env var override the defaults

So that one can effectively change the default resolution.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/529
This commit is contained in:
Jonas Ådahl 2019-04-09 10:50:28 +02:00
parent bd7704f9e1
commit 980d9b1042

View File

@ -145,14 +145,6 @@ append_monitor (MetaMonitorManager *manager,
const char *mode_specs_str;
GList *l;
for (i = 0; i < G_N_ELEMENTS (default_specs); i++)
{
CrtcModeSpec *spec;
spec = g_memdup (&default_specs[i], sizeof (CrtcModeSpec));
mode_specs = g_list_prepend (mode_specs, spec);
}
mode_specs_str = getenv ("MUTTER_DEBUG_DUMMY_MONITORS_SPECS");
if (mode_specs_str && *mode_specs_str != '\0')
{
@ -181,6 +173,16 @@ append_monitor (MetaMonitorManager *manager,
}
}
}
else
{
for (i = 0; i < G_N_ELEMENTS (default_specs); i++)
{
CrtcModeSpec *spec;
spec = g_memdup (&default_specs[i], sizeof (CrtcModeSpec));
mode_specs = g_list_prepend (mode_specs, spec);
}
}
for (l = mode_specs; l; l = l->next)
{