1
0
Fork 0

monitor-manager-kms: Use the output naming logic used by the X server

Switch to the output naming logic used by the X server's modesetting
driver which, in particular, uses drmModeConnector's connector_type_id
instead of connector_id.

The kernel generates new connector_id's every time there are changes
which means we can't identify the same monitor on the same connector
after an hardware hotplug. Switching to connector_type_id fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=770338
This commit is contained in:
Rui Matos 2016-08-24 14:47:51 +02:00
parent 7ba803934c
commit c8f24721c5

View file

@ -155,14 +155,15 @@ make_output_name (drmModeConnector *connector)
"Virtual",
"DSI",
};
const char *connector_type_name;
if (connector->connector_type < G_N_ELEMENTS (connector_type_names))
connector_type_name = connector_type_names[connector->connector_type];
return g_strdup_printf ("%s-%d",
connector_type_names[connector->connector_type],
connector->connector_type_id);
else
connector_type_name = "unknown";
return g_strdup_printf ("%s%d", connector_type_name, connector->connector_id);
return g_strdup_printf ("Unknown%d-%d",
connector->connector_type,
connector->connector_type_id);
}
static void