Getting window previews
adlo
adloconwy at gmail.com
Sat Jul 18 02:20:20 CEST 2015
How do I get the width, height and plane mask of the window?
> On 18 Jul 2015, at 00:48, Matthew Brush <mbrush at codebrainz.ca> wrote:
>
>> On 15-07-17 02:09 PM, adlo wrote:
>> What functions does skippy-xd use to get the previews?
>>
>
> I have no idea what that is.
>
>> [...]
>>
>> What functions does xfwm4 use?
>>
>
> I have no idea, I would guess XGetImage or something else depending on X extensions maybe. There was a thread about it on this mailing list a while back (search for "Window previews in xfwm4"), maybe it gives some ideas.
>
>> How CPU-efficient is XGetImage (or XShmGetImage) compared to the other two methods? Which method is the most CPU-efficient?
>>
>
> I don't know what the other two methods are but I would guess they're "efficient enough". If you got everything working and after using/profiling found too slow, then you could look to more advanced ways. I've used XGetImage before on dual-screen root window, showing a preview in a widget at ~30fps and it was "fast enough" for my use.
>
>> Do you know any details about the methods I could use to convert the image to a GdkPixbuf?
>>
>
> If it's for preview you probably don't need GdkPixbuf as you can convert straight from an XImage to a Cairo image surface and paint it onto a widget. There's probably tricks to avoid extra copying too, I'm no expert on Xlib stuff.
>
> 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