diff options
author | 2015-12-20 11:56:13 -0500 | |
---|---|---|
committer | 2015-12-20 11:56:13 -0500 | |
commit | dfc23086fd9597a5f9c7182851052435e134be5f (patch) | |
tree | 946a056785f05744932f21538a90f5687deb299c /swaylock/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 'swaylock/main.c')
-rw-r--r-- | swaylock/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index 82b88731..eccb902e 100644 --- a/swaylock/main.c +++ b/swaylock/main.c | |||
@@ -113,6 +113,7 @@ int main(int argc, char **argv) { | |||
113 | 113 | ||
114 | registry->input->notify = notify_key; | 114 | registry->input->notify = notify_key; |
115 | 115 | ||
116 | #ifdef WITH_GDK_PIXBUF | ||
116 | GError *err = NULL; | 117 | GError *err = NULL; |
117 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(argv[1], &err); // TODO: Parse i3lock arguments | 118 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(argv[1], &err); // TODO: Parse i3lock arguments |
118 | if (!pixbuf) { | 119 | if (!pixbuf) { |
@@ -120,6 +121,9 @@ int main(int argc, char **argv) { | |||
120 | } | 121 | } |
121 | cairo_surface_t *image = gdk_cairo_image_surface_create_from_pixbuf(pixbuf); | 122 | cairo_surface_t *image = gdk_cairo_image_surface_create_from_pixbuf(pixbuf); |
122 | g_object_unref(pixbuf); | 123 | g_object_unref(pixbuf); |
124 | #else | ||
125 | cairo_surface_t *image = cairo_image_surface_create_from_png(argv[1]); | ||
126 | #endif //WITH_GDK_PIXBUF | ||
123 | if (!image) { | 127 | if (!image) { |
124 | sway_abort("Failed to read background image."); | 128 | sway_abort("Failed to read background image."); |
125 | } | 129 | } |