gnome-desktop r5313 - in trunk/libgnome-desktop: . libgnomeui



Author: federico
Date: Thu Dec  4 00:29:21 2008
New Revision: 5313
URL: http://svn.gnome.org/viewvc/gnome-desktop?rev=5313&view=rev

Log:
Report errors from crtc_assignment_new()

Signed-off-by: Federico Mena Quintero <federico novell com>

Modified:
   trunk/libgnome-desktop/gnome-rr-config.c
   trunk/libgnome-desktop/libgnomeui/gnome-rr.h

Modified: trunk/libgnome-desktop/gnome-rr-config.c
==============================================================================
--- trunk/libgnome-desktop/gnome-rr-config.c	(original)
+++ trunk/libgnome-desktop/gnome-rr-config.c	Thu Dec  4 00:29:21 2008
@@ -69,7 +69,8 @@
 static gboolean         crtc_assignment_apply (CrtcAssignment   *assign,
 					       GError          **error);
 static CrtcAssignment  *crtc_assignment_new   (GnomeRRScreen    *screen,
-					       GnomeOutputInfo **outputs);
+					       GnomeOutputInfo **outputs,
+					       GError          **error);
 static void             crtc_assignment_free  (CrtcAssignment   *assign);
 static void             output_free           (GnomeOutputInfo  *output);
 static GnomeOutputInfo *output_copy           (GnomeOutputInfo  *output);
@@ -1153,7 +1154,7 @@
 
     outputs = make_outputs (config);
 
-    assignment = crtc_assignment_new (screen, outputs);
+    assignment = crtc_assignment_new (screen, outputs, error);
 
     outputs_free (outputs);
     
@@ -1504,12 +1505,10 @@
 }
 
 static CrtcAssignment *
-crtc_assignment_new (GnomeRRScreen *screen, GnomeOutputInfo **outputs)
+crtc_assignment_new (GnomeRRScreen *screen, GnomeOutputInfo **outputs, GError **error)
 {
     CrtcAssignment *assignment = g_new0 (CrtcAssignment, 1);
 
-    /* FMQ: return error */
-
     assignment->info = g_hash_table_new_full (
 	g_direct_hash, g_direct_equal, NULL, (GFreeFunc)crtc_info_free);
 
@@ -1526,6 +1525,14 @@
 	if (width < min_width || width > max_width ||
 	    height < min_height || height > max_height)
 	{
+	    g_set_error (error, GNOME_RR_ERROR, GNOME_RR_ERROR_BOUNDS_ERROR,
+			 _("required virtual size does not fit available size: "
+			   "req_width = %d, req_height = %d, "
+			   "min_width = %d, min_height = %d, "
+			   "max_width = %d, max_height = %d"),
+			 width, height,
+			 min_width, min_height,
+			 max_width, max_height);
 	    goto fail;
 	}
 
@@ -1533,6 +1540,9 @@
 	
 	return assignment;
     }
+    else
+	g_set_error (error, GNOME_RR_ERROR, GNOME_RR_ERROR_CRTC_ASSIGNMENT,
+		     _("could not find a suitable configuration of screens"));
     
 fail:
     crtc_assignment_free (assignment);

Modified: trunk/libgnome-desktop/libgnomeui/gnome-rr.h
==============================================================================
--- trunk/libgnome-desktop/libgnomeui/gnome-rr.h	(original)
+++ trunk/libgnome-desktop/libgnomeui/gnome-rr.h	Thu Dec  4 00:29:21 2008
@@ -59,6 +59,7 @@
     GNOME_RR_ERROR_NO_RANDR_EXTENSION,	/* RANDR extension is not present */
     GNOME_RR_ERROR_RANDR_ERROR,		/* generic/undescribed error from the underlying XRR API */
     GNOME_RR_ERROR_BOUNDS_ERROR,	/* requested bounds of a CRTC are outside the maximum size */
+    GNOME_RR_ERROR_CRTC_ASSIGNMENT,	/* could not assign CRTCs to outputs */
 } GnomeRRError;
 
 /* GnomeRRScreen */



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