[gnome-color-manager] If the output is not connected, don't try to use the EDID data



commit 45d535948c34f70b58130c9f0ee183a03a2c6e50
Author: Richard Hughes <richard hughsie com>
Date:   Mon Nov 2 10:31:56 2009 +0000

    If the output is not connected, don't try to use the EDID data

 src/gcm-utils.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/gcm-utils.c b/src/gcm-utils.c
index 214f164..8c120fd 100644
--- a/src/gcm-utils.c
+++ b/src/gcm-utils.c
@@ -41,9 +41,14 @@ gcm_utils_get_output_name (GnomeRROutput *output)
 	guint i, j;
 	const gchar *output_name;
 	gchar *name = NULL;
-	GcmEdid *edid;
+	GcmEdid *edid = NULL;
 	gboolean ret;
 
+	/* if nothing connected then fall back to the connector name */
+	ret = gnome_rr_output_is_connected (output);
+	if (!ret)
+		goto out;
+
 	/* parse the EDID to get a crtc-specific name, not an output specific name */
 	data = gnome_rr_output_get_edid_data (output);
 	edid = gcm_edid_new ();
@@ -69,7 +74,8 @@ out:
 		name = g_strdup (output_name);
 	}
 
-	g_object_unref (edid);
+	if (edid != NULL)
+		g_object_unref (edid);
 	return name;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]