sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit d06ec90a9d5d1c332a85b296b4ab6011d937f14e
parent f745a3b3ef0b575d9a3ea802c338a003b0cc6af5
Author: Linus Heckemann <git@sphalerite.org>
Date:   Mon,  3 Jul 2017 21:19:54 +0100

swaybg: check that background can be loaded

Diffstat:
Mswaybg/main.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git 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);