diff options
author | 2017-07-03 15:03:46 -0600 | |
---|---|---|
committer | 2017-07-03 15:03:46 -0600 | |
commit | 496cec3cb7ba9e2648d023b8bda09a79d1d958ed (patch) | |
tree | bb196cd8121b50da5fb91810823039110e0d44c2 /swaybg/main.c | |
parent | Merge pull request #1259 from Hummer12007/patch-4 (diff) | |
parent | swaybg: check that background can be loaded (diff) | |
download | sway-496cec3cb7ba9e2648d023b8bda09a79d1d958ed.tar.gz sway-496cec3cb7ba9e2648d023b8bda09a79d1d958ed.tar.zst sway-496cec3cb7ba9e2648d023b8bda09a79d1d958ed.zip |
Merge pull request #1256 from lheckemann/doc-png
Do not fail silently when background is not PNG
Diffstat (limited to 'swaybg/main.c')
-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) { | |||
97 | if (!image) { | 97 | if (!image) { |
98 | sway_abort("Failed to read background image."); | 98 | sway_abort("Failed to read background image."); |
99 | } | 99 | } |
100 | if (cairo_surface_status(image) != CAIRO_STATUS_SUCCESS) { | ||
101 | sway_abort("Failed to read background image: %s." | ||
102 | #ifndef WITH_GDK_PIXBUF | ||
103 | "\nSway was compiled without gdk_pixbuf support, so only" | ||
104 | "\nPNG images can be loaded. This is the likely cause." | ||
105 | #endif //WITH_GDK_PIXBUF | ||
106 | , cairo_status_to_string(cairo_surface_status(image))); | ||
107 | } | ||
100 | double width = cairo_image_surface_get_width(image); | 108 | double width = cairo_image_surface_get_width(image); |
101 | double height = cairo_image_surface_get_height(image); | 109 | double height = cairo_image_surface_get_height(image); |
102 | 110 | ||