xcb surface oddity?

Steven J Abner pheonix.sja at att.net
Wed Dec 4 23:11:27 UTC 2024


 Using cairo_surface_destroy() for clean up of a destroyed window 
causes an error in xcb. This error seems to depend on placement of the 
cairo_surface_destroy(). I was under the assumption that I, as the 
caller, per API description, am responsible for a 
cairo_xcb_surface_create().
 Conditions to cause the error of "BadPicture" are when freeing of 
resources, that I own, occurs after a xcb_destroy_window() call. If I 
call cairo_surface_destroy() before
the window destruction, no error occurs. However, one would assume that 
it still exists due to the later call of cairo_surface_destroy() on 
subsurfaces created by cairo_surface_create_for_rectangle() after 
xcb_destroy_window().
 To clarify, the only cairo_xcb_surface_create() is used as a 
'vid_buffer' with one 'simular' surface getting drawn to by multiple 
cairo_surface_create_for_rectangle() surface drawings. 'simular' gets 
'paint()'ed to the 'vid_buffer' then flushed() for an exposed event.
 Now if the destroy() of 'vid_buffer' must be before 
xcb_destroy_window() instead of after like it's 'simular', does this 
mean xcb owns the surface and I own the subsurfaces? I thought I 
understood what I was doing, the double buffer concept, but this threw 
a monkey wrench at me.
 Steve




More information about the cairo mailing list