diff options
Diffstat (limited to 'i3lock.c')
-rw-r--r-- | i3lock.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -688,6 +688,13 @@ int main(int argc, char *argv[]) { if (image_path) { /* Create a pixmap to render on, fill it with the background color */ img = cairo_image_surface_create_from_png(image_path); + /* In case loading failed, we just pretend no -i was specified. */ + if (cairo_surface_status(img) != CAIRO_STATUS_SUCCESS) { + if (debug_mode) + fprintf(stderr, "Could not load image \"%s\": cairo surface status %d\n", + image_path, cairo_surface_status(img)); + img = NULL; + } } #endif |