summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorprogandy <code@progandy>2015-12-20 17:37:52 +0100
committerprogandy <code@progandy>2015-12-20 17:37:52 +0100
commit33c4721685deda70dedab2ab755198d8e810013b (patch)
treec524773788694438c24e8ccc374306bc2162c95c /main.c
parentd215cebec2b5d0c5318e060d9c5dbc8152f7cace (diff)
downloadswaybg-33c4721685deda70dedab2ab755198d8e810013b.tar.gz
swaybg-33c4721685deda70dedab2ab755198d8e810013b.tar.bz2
make gdk-pixbuf dependency really optional
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 2ae06c6..b936be2 100644
--- a/main.c
+++ b/main.c
@@ -56,6 +56,7 @@ int main(int argc, const char **argv) {
desktop_shell_set_background(registry->desktop_shell, output->output, window->surface);
list_add(surfaces, window);
+#ifdef WITH_GDK_PIXBUF
GError *err = NULL;
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(argv[2], &err);
if (!pixbuf) {
@@ -63,6 +64,9 @@ int main(int argc, const char **argv) {
}
cairo_surface_t *image = gdk_cairo_image_surface_create_from_pixbuf(pixbuf);
g_object_unref(pixbuf);
+#else
+ cairo_surface_t *image = cairo_image_surface_create_from_png(argv[2]);
+#endif //WITH_GDK_PIXBUF
if (!image) {
sway_abort("Failed to read background image.");
}