Window previews in xfwm4

Olivier Fourdan fourdan at
Mon Jan 12 19:10:28 CET 2015


I haven't looked much at the code, but using XGetImage and XImage
conversion seem inappropriate here.

Using a compositor, all client windows are unredirected, meaning they
are rendered to an offscreen pixmap already, and the compositor has
all that's required already, it "knows" about all this so all you need
to do is to add hooks in the compositor to retrieve this and use that
picture, that's all. Metacity's compositor was based originally on
xfwm4's and had that feature up until not too long ago (not sure it's
still there), you should look there for an example.

Also, please note that the gtk_ prefix is for gtk alone.


On 11 January 2015 at 02:25, Sonal Santan <sonal.santan at> wrote:
> Hello,
> I have upstreamed my changes for window previews to
> for folks to try out. There is one bug I
> am still trying to track down -- occasionally, the preview comes out as
> blank for a minimized window. I capture the previews of windows which are
> about to be minimized inside unmap_win() hook of the compositor. Is this the
> correct location for capturing the previews of windows which are about to be
> minimized?
> For folks who are curious, the new function, update_win_preview() defined in
> compositor.c captures the previews. XImage to GdkPixbuf conversion happens
> in the new function, gdk_pixbuf_xlib_get_from_image() defined in a new file
> previews.c.
> Will submit patches to the list after I have taken care of the bug mentioned
> above.
> -Sonal
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at

More information about the Xfce4-dev mailing list