summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Brüschweiler <blei42@gmail.com>2013-04-15 20:10:40 +0200
committerKristian Høgsberg <krh@bitplanet.net>2013-04-15 20:57:55 -0400
commit96386b8e5ef222025acbb5fe604244e626eb8573 (patch)
treead6dc4b18287825979e32c3a308103f071bdf1f0
parent4a3c150c96efb4e91aea1ecd25d85cf89e4d8416 (diff)
desktop-shell: better error logging
v2: only call cairo_surface_status once
-rw-r--r--clients/desktop-shell.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 41e7daa7..38af6c6e 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,