First of all, windows cannot be transparent under X11. You have to
create the illusion of transparency by copying the covered part of the
background image into your window.
The XAtom _XROOTPMAP_ID on the root window contains the XID of the
background pixmap.
You have to read the XID and get access to the pixmap with
gdk_pixmap_foreign_new(xid).
Then you just copy the part that is covered into your window and
that's it. This part may be tricky because you have to handle the
cases when the pixmap is tiled over the desktop, or the pixmap being
smaller than your window.
The function get_wallpaper() in desktop.py shows how I solved the
tiling problem finally.[/code]