commit dbba0d51bfcf549c3d9f3f5a49465abab6e01c1f Author: Carl Worth Date: Wed Jul 26 15:48:56 2006 -0700 Don't call XRenderAddGlyphs for zero-sized surfaces (bug #7494) The bug in 7494 is really an X server bug, and this is perhaps only a partial workaround. There's probably a better place this workaround could be implemented in cairo since with this patch cairo still attempts to render glyphs even after not adding them to the server- side glyph cache. So I'm not sure if this might not cause strange things to happen. A very minimal bit of testing suggests that this patch does help, (firefox stops having disappearing text for example). diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index cac6787..fc50a07 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -2455,10 +2455,12 @@ _cairo_xlib_surface_add_glyph (Display * glyph_index = _cairo_scaled_glyph_index (scaled_glyph); - XRenderAddGlyphs (dpy, font_private->glyphset, - &glyph_index, &(glyph_info), 1, - (char *) data, - glyph_surface->stride * glyph_surface->height); + if (glyph_surface->width || glyph_surface->height) { + XRenderAddGlyphs (dpy, font_private->glyphset, + &glyph_index, &(glyph_info), 1, + (char *) data, + glyph_surface->stride * glyph_surface->height); + } if (data != glyph_surface->data) free (data);