]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/include/cairo_util.h
Introduce a macro to flush a cairo surface twice.
[i3/i3] / i3bar / include / cairo_util.h
index 37eaa6e24c30af05319dbd77e833389208d3b1b7..3e4ebec4f143dec0dbf1a278e0f06c9a6c448a89 100644 (file)
 
 #include <cairo/cairo-xcb.h>
 
+/* We need to flush cairo surfaces twice to avoid an assertion bug. See #1989
+ * and https://bugs.freedesktop.org/show_bug.cgi?id=92455. */
+#define CAIRO_SURFACE_FLUSH(surface)  \
+    do {                              \
+        cairo_surface_flush(surface); \
+        cairo_surface_flush(surface); \
+    } while (0)
+
 /* Represents a color split by color channel. */
 typedef struct color_t {
     double red;