My analysis into this bug indicates that the RenderBadPicture results from a delayed cairo_surface_destroy() after firefox has called XDestroyWindow() on the *parent* Window. In this situation firefox should be calling cairo_surface_finish(), or cairo_surface_destroy() and disposing of the cairo_surface_t, on the destroyed hierarchy.
So the RenderBadPicture is a separate bug (and not ours! ;-) from the XID reuse.
My analysis into this bug indicates that the RenderBadPicture results from a delayed cairo_surface_ destroy( ) after firefox has called XDestroyWindow() on the *parent* Window. In this situation firefox should be calling cairo_surface_ finish( ), or cairo_surface_ destroy( ) and disposing of the cairo_surface_t, on the destroyed hierarchy.
So the RenderBadPicture is a separate bug (and not ours! ;-) from the XID reuse.