diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2017-07-03 21:19:54 +0100 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2017-07-03 21:19:54 +0100 |
| commit | f0128963cea46675286660a9ea862e2ac4a4efb0 (patch) | |
| tree | f8d390a84d95d42d16953943c5b91deb23806b9a /swaybg | |
| parent | 2f8513dbce9d0bbffe8007c20f3ad2a57b1b31c1 (diff) | |
swaybg: check that background can be loaded
Diffstat (limited to 'swaybg')
| -rw-r--r-- | swaybg/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/swaybg/main.c b/swaybg/main.c index 9dba0c8f..2fdd4220 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); |
