MonitorXrandr: try harder to get decent product/serial IDs
If the EDID does not include free-form product name and serial number, use the numeric IDs instead, like gnome-desktop did. https://bugzilla.gnome.org/show_bug.cgi?id=706233
This commit is contained in:
parent
1bde397edf
commit
909a6607c5
1 changed files with 8 additions and 2 deletions
|
@ -455,8 +455,14 @@ meta_monitor_manager_xrandr_read_current (MetaMonitorManager *manager)
|
|||
if (parsed_edid)
|
||||
{
|
||||
meta_output->vendor = g_strndup (parsed_edid->manufacturer_code, 4);
|
||||
if (parsed_edid->dsc_product_name[0])
|
||||
meta_output->product = g_strndup (parsed_edid->dsc_product_name, 14);
|
||||
else
|
||||
meta_output->product = g_strdup_printf ("0x%04x", (unsigned)parsed_edid->product_code);
|
||||
if (parsed_edid->dsc_serial_number[0])
|
||||
meta_output->serial = g_strndup (parsed_edid->dsc_serial_number, 14);
|
||||
else
|
||||
meta_output->serial = g_strdup_printf ("0x%08x", parsed_edid->serial_number);
|
||||
|
||||
g_free (parsed_edid);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue