Getting window previews

adlo adloconwy at gmail.com
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 codebrainz.ca> 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:
> 
> https://developer.gnome.org/gdk-pixbuf/unstable/gdk-pixbuf-X-Drawables-to-Pixbufs.html#gdk-pixbuf-xlib-get-from-drawable
> 
> 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 xfce.org
> https://mail.xfce.org/mailman/listinfo/xfce4-dev


More information about the Xfce4-dev mailing list