Getting window previews

adlo adloconwy at
Tue Aug 4 00:15:30 CEST 2015

How do I make a Cairo surface from the Pixmap and draw it onto a widget?

> On 1 Aug 2015, at 01:04, Matthew Brush <mbrush at> wrote:
>> On 15-07-31 11:09 AM, adlo wrote:
>> I am writing a GTK2 program that gets previews of all open windows. It uses the XCompositeNameWindowPixmap function.
>> How do I put these previews into GtkImages?
> You'd probably get better answers on a GTK+ (or XLib) related mailing list but I think this function does what you want:
> And then create the GtkImage from the GdkPixbuf. I'd probably use Cairo for this myself since you can just make a surface from the Pixmap and draw it straight onto whichever widget you need (ex. a GtkDrawingArea).
> Cheers,
> Matthew Brush
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at

More information about the Xfce4-dev mailing list