From 36fcb954bd244007609593e043a9b2d212f486de Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 3 Jul 2017 15:03:46 -0600 Subject: [PATCH] Merge pull request #1256 from lheckemann/doc-png Do not fail silently when background is not PNG --- swaybg/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/swaybg/main.c b/swaybg/main.c index 9dba0c8f8..2fdd4220b 100644 --- a/swaybg/main.c +++ b/swaybg/main.c @@ -97,6 +97,14 @@ int main(int argc, const char **argv) { if (!image) { sway_abort("Failed to read background image."); } + if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) { + sway_abort("Failed to read background image: %s." +#ifndef WITH_GDK_PIXBUF + "\nSway was compiled without gdk_pixbuf support, so only" + "\nPNG images can be loaded. This is the likely cause." +#endif //WITH_GDK_PIXBUF + , cairo_status_to_string(cairo_surface_status(image))); + } double width = cairo_image_surface_get_width(image); double height = cairo_image_surface_get_height(image);