Window.getVisibleRegion

cairo.region.Region getVisibleRegion()

Computes the region of the window that is potentially visible. This does not necessarily take into account if the window is obscured by other windows, but no area outside of this region is visible.

Returns

a #cairo_region_t. This must be freed with [cairo.region.Region.destroy]

when you are done.