 id = XInternAtom (Xdisplay, "_XROOTPMAP_ID", True);
XGetWindowProperty (Xdisplay, Xroot, id, 0, 1, False, XA_PIXMAP,
			        &act_type, &act_format, &nitems, &bytes_after,
				&prop) == Success)
	currentRootPixmap = *((Pixmap *) prop);
		XFree (prop);
XGetGeometry (Xdisplay, p, &root, &junk, &junk, pWidth, pHeight, &junk, &junk))
    	    p = None ;

 XFreePixmap( Xdisplay, tCache.cache );o
	    if( !GetWinPosition(win, NULL,NULL)) return None ;
    	    if( !XGetGeometry(Xdisplay, win,
    		 &root, &x, &y, &w, &h, &border, &depth)) return None;
	    x+=border ;
	    y+=border ;	    
	    w-=border*2+1;
	    h-=border*2+1;
	    src_w = w+x ;
	    src_h = h+y ;
            /* of course we can do withou it, but to make code more generic */
	    if( !XQueryTree( Xdisplay, win, &root, &src, &children, &nchildren ))
	        src = None ; /* just in case */
	    else if( children ) XFree( children );
CREATE_TRG_PIXMAP(min(w,src_w), min(h, src_h))))
 CopyAndShadeArea( src, trg, x, y, w, h, 0, 0, gc, shading);	
 XMapWindow( Xdisplay, win );



#define CREATE_TRG_PIXMAP(w,h) XCreatePixmap(Xdisplay, Xroot, w, h, Xdepth)

XGetImage (Xdisplay, src, x, y, w, h, AllPlanes, ZPixmap))!= NULL )
        {
  XPutImage(Xdisplay, trg, gc, img, 0, 0, trg_x, trg_y, w, h);
	    XDestroyImage( img );


