aboutsummaryrefslogtreecommitdiff
path: root/swaybg
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-07-03 15:03:46 -0600
committerGitHub <noreply@github.com>2017-07-03 15:03:46 -0600
commit496cec3cb7ba9e2648d023b8bda09a79d1d958ed (patch)
treebb196cd8121b50da5fb91810823039110e0d44c2 /swaybg
parent401b80501a6b285562f83ab7e47a7062e91a6e77 (diff)
parentd06ec90a9d5d1c332a85b296b4ab6011d937f14e (diff)
Merge pull request #1256 from lheckemann/doc-png
Do not fail silently when background is not PNG
Diffstat (limited to 'swaybg')
-rw-r--r--swaybg/main.c8
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);