[gtk+/wip/matthiasc/monitor] inspector: Show better monitor label
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/monitor] inspector: Show better monitor label
- Date: Sun, 3 Apr 2016 14:51:39 +0000 (UTC)
commit a267c20531cdf57756d462ce70085be1243bb94f
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Apr 2 19:22:36 2016 -0400
inspector: Show better monitor label
We can now show the manufacturer as well.
gtk/inspector/general.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c
index 4c420a9..1ccfb87 100644
--- a/gtk/inspector/general.c
+++ b/gtk/inspector/general.c
@@ -317,6 +317,9 @@ populate_display (GdkScreen *screen, GtkInspectorGeneral *gen)
gint i;
GList *children, *l;
GtkWidget *child;
+ GdkDisplay *display;
+ GdkMonitor **monitors;
+ int n_monitors;
children = gtk_container_get_children (GTK_CONTAINER (gen->priv->x_box));
for (l = children; l; l = l->next)
@@ -341,20 +344,18 @@ populate_display (GdkScreen *screen, GtkInspectorGeneral *gen)
if (gdk_screen_is_composited (screen))
gtk_widget_show (gen->priv->x_composited);
- for (i = 0; i < gdk_screen_get_n_monitors (screen); i++)
+ display = gdk_screen_get_display (screen);
+ monitors = gdk_display_get_monitors (display, &n_monitors);
+ for (i = 0; i < n_monitors; i++)
{
gchar *name;
gchar *value;
- gchar *plug_name;
GdkRectangle rect;
gint w, h, wmm, hmm, scale;
- plug_name = gdk_screen_get_monitor_plug_name (screen, i);
- if (plug_name)
- name = g_strdup_printf ("Monitor %s", plug_name);
- else
- name = g_strdup_printf ("Monitor %d", i);
- g_free (plug_name);
+ name = g_strdup_printf ("Monitor %s %s",
+ gdk_monitor_get_manufacturer (monitors[i]),
+ gdk_monitor_get_model (monitors[i]));
gdk_screen_get_monitor_geometry (screen, i, &rect);
w = rect.width;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]