Introduce switch for the drawing backend

This commit restores the old XCB drawing code paths while keeping the
cairo drawing available via a compile-time switch (I3BAR_CAIRO). This
is necessary as cairo currently has a bug that breaks i3bar for users
without the RENDER extension, which might be the case, e.g., for VNC
users.

For more context, see #1989 and the discussions about its fix. Once the
cairo fix is available in a stable release, i3 can depend on that version
and remove the XCB drawing code paths.

fixes #1989
This commit is contained in:
Ingo Bürk
2015-10-14 20:49:52 +02:00
parent 46bcc55f6f
commit 02468296c4
6 changed files with 142 additions and 112 deletions

View File

@ -133,11 +133,6 @@ static void draw_text_pango(const char *text, size_t text_len,
cairo_move_to(cr, x, y - yoffset);
pango_cairo_show_layout(cr, layout);
/* We need to flush cairo surfaces twice to avoid an assertion bug. See #1989
* and https://bugs.freedesktop.org/show_bug.cgi?id=92455. */
cairo_surface_flush(surface);
cairo_surface_flush(surface);
/* Free resources */
g_object_unref(layout);
cairo_destroy(cr);