diff options
author | Federico Mena Quintero <federico@novell.com> | 2008-12-04 00:27:06 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2008-12-04 00:27:06 +0000 |
commit | 8357204086e0b5480bb16853ba1514340833e2ab (patch) | |
tree | afb80e2f0fe19940c500ec95441d0b97fc233a07 | |
parent | 743c2206834d280570012efd8e43d00e3c9e98f0 (diff) | |
download | gnome-desktop-8357204086e0b5480bb16853ba1514340833e2ab.tar.gz |
Report errors from output_initialize()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=5303
-rw-r--r-- | libgnome-desktop/gnome-rr.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c index 5f86b30f..03aa3b38 100644 --- a/libgnome-desktop/gnome-rr.c +++ b/libgnome-desktop/gnome-rr.c @@ -128,8 +128,9 @@ static gboolean crtc_initialize (GnomeRRCrtc *crtc, /* GnomeRROutput */ static GnomeRROutput *output_new (ScreenInfo *info, RROutput id); -static void output_initialize (GnomeRROutput *output, - XRRScreenResources *res); +static gboolean output_initialize (GnomeRROutput *output, + XRRScreenResources *res, + GError **error); static void output_free (GnomeRROutput *output); /* GnomeRRMode */ @@ -420,7 +421,13 @@ fill_out_screen_info (Display *xdisplay, } for (output = info->outputs; *output; ++output) - output_initialize (*output, resources); /* FMQ: return error */ + { + if (!output_initialize (*output, resources, error)) + { + screen_info_free (info); + return FALSE; + } + } for (i = 0; i < resources->nmode; ++i) { @@ -774,8 +781,8 @@ read_edid_data (GnomeRROutput *output) return NULL; } -static void -output_initialize (GnomeRROutput *output, XRRScreenResources *res) +static gboolean +output_initialize (GnomeRROutput *output, XRRScreenResources *res, GError **error) { XRROutputInfo *info = XRRGetOutputInfo ( DISPLAY (output), res, output->id); @@ -788,9 +795,11 @@ output_initialize (GnomeRROutput *output, XRRScreenResources *res) if (!info || !output->info) { - /* FIXME */ - /* FMQ: return error */ - return; + /* FIXME: see the comment in crtc_initialize() */ + g_set_error (error, GNOME_RR_ERROR, GNOME_RR_ERROR_RANDR_ERROR, + _("could not get information about output %d"), + (int) output->id); + return FALSE; } output->name = g_strdup (info->name); /* FIXME: what is nameLen used for? */ |