aboutsummaryrefslogtreecommitdiff
path: root/swaylock/main.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-12-20 11:56:13 -0500
committerDrew DeVault <sir@cmpwn.com>2015-12-20 11:56:13 -0500
commitdfc23086fd9597a5f9c7182851052435e134be5f (patch)
tree946a056785f05744932f21538a90f5687deb299c /swaylock/main.c
parent66554698a08e8c3846d22f61445c880c9de20e26 (diff)
parent21014e606b9b28d792b98cf363f20c7df2136723 (diff)
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.c4
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) {
registry->input->notify = notify_key;
+#ifdef WITH_GDK_PIXBUF
GError *err = NULL;
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(argv[1], &err); // TODO: Parse i3lock arguments
if (!pixbuf) {
@@ -120,6 +121,9 @@ int main(int argc, 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[1]);
+#endif //WITH_GDK_PIXBUF
if (!image) {
sway_abort("Failed to read background image.");
}