diff options
| author | Burt P <pburt0@gmail.com> | 2017-10-28 11:47:35 -0500 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2017-11-02 18:14:09 -0700 | 
| commit | 34ebc7e5d99c9d41a28b842cca433041bb92f9d2 (patch) | |
| tree | 6ed62cf97ef3acef81f450d23fb312e781e999de | |
| parent | 9114299df972f43bef08e64da81fe39896334a81 (diff) | |
Computer/Display: Add X Display Name
A field exists in struct _DisplayInfo, but it wasn't being
filled or shown.
Perhaps fix:
https://github.com/lpereira/hardinfo/issues/181
Signed-off-by: Burt P <pburt0@gmail.com>
| -rw-r--r-- | modules/computer.c | 1 | ||||
| -rw-r--r-- | modules/computer/display.c | 6 | 
2 files changed, 5 insertions, 2 deletions
diff --git a/modules/computer.c b/modules/computer.c index c7581be4..ea6762a7 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -582,6 +582,7 @@ gchar *callback_display(void)                  computer->display->width, computer->display->height),          info_field(_("Vendor"), computer->display->vendor),          info_field(_("Version"), computer->display->version), +        info_field(_("Current Display Name"), computer->display->display_name),          info_field_last());      info_add_computed_group(info, _("Monitors"), computer->display->monitors); diff --git a/modules/computer/display.c b/modules/computer/display.c index fccf9309..61eac4eb 100644 --- a/modules/computer/display.c +++ b/modules/computer/display.c @@ -75,8 +75,9 @@ get_x11_info(DisplayInfo *di)  	g_free(output);  	old = output_lines; -	while (*(output_lines++)) { -            gchar **tmp = g_strsplit(*output_lines, ":", 0); +	while (*output_lines) { +            gchar **tmp = g_strsplit(*output_lines, ":", 2); +            output_lines++;              if (tmp[1] && tmp[0]) {                tmp[1] = g_strchug(tmp[1]); @@ -84,6 +85,7 @@ get_x11_info(DisplayInfo *di)                get_str("vendor string", di->vendor);                get_str("X.Org version", di->version);                get_str("XFree86 version", di->version); +              get_str("name of display", di->display_name);                if (g_str_has_prefix(tmp[0], "number of extensions")) {                  int n;  | 
