From d7ec8bf165b68a4e48b916c23c4262e01d07f128 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Mon, 18 Sep 2017 19:14:44 +0200 Subject: [PATCH] Explain counterintuitive gdk pixbuf conversion --- src/x11/x.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/x11/x.c b/src/x11/x.c index 552110e..881b1af 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -301,6 +301,13 @@ static cairo_status_t read_from_buf(void *closure, unsigned char *data, unsigned static cairo_surface_t *gdk_pixbuf_to_cairo_surface(GdkPixbuf *pixbuf) { + /* + * Export the gdk pixbuf into buffer as a png and import the png buffer + * via cairo again as a cairo_surface_t. + * It looks counterintuitive, as there is gdk_cairo_set_source_pixbuf, + * which does the job faster. But this would require gtk3 as a dependency + * for a single function call. See discussion in #334 and #376. + */ cairo_surface_t *icon_surface = NULL; GByteArray *buffer; char *bufstr;