Getting window previews

adlo adloconwy at gmail.com
Fri Jul 17 23:09:25 CEST 2015


What functions does skippy-xd use to get the previews?

(I can see some functions such as XCompositeRedirectWindow, XCompositeNameWindowPixmap, and XRenderCreatePicture, but I don't know if this is relevant)

What functions does xfwm4 use?

How CPU-efficient is XGetImage (or XShmGetImage) compared to the other two methods? Which method is the most CPU-efficient?

Do you know any details about the methods I could use to convert the image to a GdkPixbuf?

Regards

adlo



> On 17 Jul 2015, at 01:30, Matthew Brush <mbrush at codebrainz.ca> wrote:
> 
>> On 15-07-16 11:43 AM, adlo wrote:
>> Do you know of anyone who might know how skippy-xd works, or anyone
>> who might know how to convert an X11 pixmap into a GdkPixbuf?
>> 
> 
> There's
> 
> https://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-Image-Data-in-Memory.html#gdk-pixbuf-new-from-xpm-data
> 
> I'm not sure that's the way to do it though. I don't think it's terribly hard to capture a window using XLib. I think the general idea is to call XGetImage() (or XShmGetImage() maybe) on whichever window you want and then just iterating the pixels into a GdkPixbuf or cairo_surface_t or whatever (they probably even have functions to do that part for you from X11 pixel formats).
> 
> 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