This is a followup for Screenshot test helper has issues with synchronizing rendering (assertion in _cairo_surface_has_mime_data). I am still getting this assertion for a few of my tests that take screenshots:
cairo_surface_mark_dirty_rectangle: Assertion `! _cairo_surface_has_mime_data (surface)' failed
It is the call to gdk_pixbuf_get_from_window
that sometimes fails with this assertion. Unless this is a bug that is already fixed later, what would be things to do beforehand to ensure that this assertion is not triggered.
To me it sounds like there is a bug. I am not mucking with gtk internals and the docs for cairo_surface_mark_dirty()
hint that something should have called cairo_surface_flush
but didn’t.
The docs for gdk_pixbuf_get_from_window describe how the function can fail, but unfortunately it is not failinf but terminating the test (the assertion triggers abort()).
When I compare cases the work and those that fail, I see no difference from the gtk pov. The windows are realized, mapped and visible.
I am using gtk+3.24.2-3 on debian.