diff options
author | 2015-12-20 11:56:13 -0500 | |
---|---|---|
committer | 2015-12-20 11:56:13 -0500 | |
commit | dfc23086fd9597a5f9c7182851052435e134be5f (patch) | |
tree | 946a056785f05744932f21538a90f5687deb299c /swaybg/main.c | |
parent | Update README screenshot (diff) | |
parent | make gdk-pixbuf dependency really optional (diff) | |
download | sway-dfc23086fd9597a5f9c7182851052435e134be5f.tar.gz sway-dfc23086fd9597a5f9c7182851052435e134be5f.tar.zst sway-dfc23086fd9597a5f9c7182851052435e134be5f.zip |
Merge pull request #377 from progandy/optional-pixbuf
make gdk-pixbuf dependency really optional
Diffstat (limited to 'swaybg/main.c')
-rw-r--r-- | swaybg/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/swaybg/main.c b/swaybg/main.c index 2ae06c6f..b936be2b 100644 --- a/swaybg/main.c +++ b/swaybg/main.c | |||
@@ -56,6 +56,7 @@ int main(int argc, const char **argv) { | |||
56 | desktop_shell_set_background(registry->desktop_shell, output->output, window->surface); | 56 | desktop_shell_set_background(registry->desktop_shell, output->output, window->surface); |
57 | list_add(surfaces, window); | 57 | list_add(surfaces, window); |
58 | 58 | ||
59 | #ifdef WITH_GDK_PIXBUF | ||
59 | GError *err = NULL; | 60 | GError *err = NULL; |
60 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(argv[2], &err); | 61 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(argv[2], &err); |
61 | if (!pixbuf) { | 62 | if (!pixbuf) { |
@@ -63,6 +64,9 @@ int main(int argc, const char **argv) { | |||
63 | } | 64 | } |
64 | cairo_surface_t *image = gdk_cairo_image_surface_create_from_pixbuf(pixbuf); | 65 | cairo_surface_t *image = gdk_cairo_image_surface_create_from_pixbuf(pixbuf); |
65 | g_object_unref(pixbuf); | 66 | g_object_unref(pixbuf); |
67 | #else | ||
68 | cairo_surface_t *image = cairo_image_surface_create_from_png(argv[2]); | ||
69 | #endif //WITH_GDK_PIXBUF | ||
66 | if (!image) { | 70 | if (!image) { |
67 | sway_abort("Failed to read background image."); | 71 | sway_abort("Failed to read background image."); |
68 | } | 72 | } |