This bug appeared somewhere between Cairo 1.10.2 and 1.12.4, as I could check by downgrading my packages. It has been experienced on Fedora [1] and Arch [2], at least. Using the R statistical framework, plots are not drawn until one resizes the plot window. Disabling buffered rendering using X11.options(type="nbcairo") fixes the problem. If you are interested in reproducing the bug, calling plot(1:10) is enough. The problem has been reported by people with Intel GPUs (i915 driver) and with ATI GPUs (Catalyst driver). So it seems to be a Cairo bug, or at least a change in Cairo unveiled a bug in these drivers. If you have any suspicion of the commit that may have introduced this, I can test that version. 1: https://bugzilla.redhat.com/show_bug.cgi?id=891983 2: https://bugs.archlinux.org/task/32597
Broad guess: R is not calling cairo_surface_flush() when it should. Before this function is called, the content of the drawable used is undefined. Cairo 1.12 makes more use of this requirement (which has been there since forever). I would be very surprised if this were actually a bug in cairo.
Ok, I went and checked R's source code: R-2.15.2/src/modules/X11/devX11.c, function handleEvent(), line 750. This is the handling of Expose events and it just does a cairo_paint(xd->xcc). This also needs cairo_surface_flush(xd->xcs).
Thanks for looking at the code, but your suggestion does not make any difference in my tests. The problem is, the Expose event is never triggered by X so that code is not run. I also tried adding cairo_surface_flush() calls in many other places, with no result. So I sent a mail to R-devel, let's see what they say: https://mailman.stat.ethz.ch/pipermail/r-devel/2013-January/065567.html Thanks!
Sorry for reopening, but somebody downstream told me the bug does not happen using the Nouveau driver - so it would be an Intel specific bug. Does that help you identifying where the bug might be? Is it still possible that it is an R bug? I guess you're in the best position to tell me who I should complain to. ;-) Thanks!
Actually, the bug happens with ATI's Catalyst proprietary driver, but not with NVidia's. To me, this sounds like the NVidia driver forces a draw/flush/something, while the others do not. Is that of any help?
Damn, I was wrong again. Let me restate the situation: Intel and ATI Catalyst drivers suffer from the bug; Nouveau (*not* NVidia proprietary) does not suffer from it.
OK, R developers have found how to use cairo_surface_flush() to fix the bug (where I failed), so you were right. But they complained that cairo_surface_flush() documentation "does not support this usage". Do you think this could be improved? Thanks for your help so far!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.