[PATCH weston v2] desktop-shell: better error logging

Kristian Høgsberg hoegsberg at gmail.com
Mon Apr 15 17:56:42 PDT 2013


On Mon, Apr 15, 2013 at 08:10:40PM +0200, Philipp Brüschweiler wrote:
> v2: only call cairo_surface_status once
> ---
>  clients/desktop-shell.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Thanks, applied.

> diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
> index 41e7daa..38af6c6 100644
> --- a/clients/desktop-shell.c
> +++ b/clients/desktop-shell.c
> @@ -519,13 +519,16 @@ static cairo_surface_t *
>  load_icon_or_fallback(const char *icon)
>  {
>  	cairo_surface_t *surface = cairo_image_surface_create_from_png(icon);
> +	cairo_status_t status;
>  	cairo_t *cr;
>  
> -	if (cairo_surface_status(surface) == CAIRO_STATUS_SUCCESS)
> +	status = cairo_surface_status(surface);
> +	if (status == CAIRO_STATUS_SUCCESS)
>  		return surface;
>  
>  	cairo_surface_destroy(surface);
> -	fprintf(stderr, "ERROR loading icon from file '%s'\n", icon);
> +	fprintf(stderr, "ERROR loading icon from file '%s', error: '%s'\n",
> +		icon, cairo_status_to_string(status));
>  
>  	/* draw fallback icon */
>  	surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
> -- 
> 1.8.2.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list