From af44c97ff95a6681ea39abea9a1bd6064fd10fbe Mon Sep 17 00:00:00 2001 From: "P. Pronk" Date: Tue, 10 Jan 2017 14:44:46 +0100 Subject: [PATCH] When using multiple monitors from the same brand and size, its currently a guess which monitor is which in the combobox. This commit adds some more detail by using the EDID 0xFC (product name) descriptor as display_name if 0xFC contains the vendor name. Otherwise 0xFC is added in brackets to the default display_name, e.g. 'Samsung 21" (SyncMaster)' --- dialogs/display-settings/display-name.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dialogs/display-settings/display-name.c b/dialogs/display-settings/display-name.c index 3e70b08..c03d9d7 100644 --- a/dialogs/display-settings/display-name.c +++ b/dialogs/display-settings/display-name.c @@ -33,6 +33,9 @@ #include #include #include +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include #include #include "edid.h" @@ -2520,7 +2523,18 @@ make_display_name (const MonitorInfo *info, guint output) inches = -1; } - if (inches > 0) + if (strlen(info->dsc_product_name) > 0) + { + if (strcasestr(info->dsc_product_name, vendor) != NULL) + { + return g_strdup_printf ("%i. %s", output+1, info->dsc_product_name); + } + else + { + return g_strdup_printf ("%i. %s %d\" (%s)", output+1, vendor, inches, info->dsc_product_name); + } + } + else if (inches > 0) return g_strdup_printf ("%i. %s %d\"", output+1, vendor, inches); else return g_strdup_printf ("%i. %s ", output+1, vendor); -- 2.7.4