summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2017-07-03 21:19:54 +0100
committerLinus Heckemann <git@sphalerite.org>2017-07-03 22:02:49 +0100
commit469f0f51fbed78c29fbef13dd8a0f6659ff24bda (patch)
treeb69f1bcaef6b23c90072f0a981e4636adf0d6b18 /main.c
parent3f3b225213322d7c52546a108dc64096be52c6e6 (diff)
downloadswaybg-469f0f51fbed78c29fbef13dd8a0f6659ff24bda.tar.gz
swaybg-469f0f51fbed78c29fbef13dd8a0f6659ff24bda.tar.bz2
swaybg: check that background can be loaded
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.c b/main.c
index 9dba0c8..2fdd422 100644
--- a/main.c
+++ b/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);