+Picture
+root_tile (Display *dpy)
+{
+ Picture picture;
+ Atom actual_type;
+ Pixmap pixmap;
+ int actual_format;
+ unsigned long nitems;
+ unsigned long bytes_after;
+ unsigned char *prop;
+ Bool fill;
+ XRenderPictureAttributes pa;
+
+ if (XGetWindowProperty (dpy, root, XInternAtom (dpy, "_XROOTPMAP_ID", False),
+ 0, 4, False, AnyPropertyType,
+ &actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success)
+ {
+ memcpy (&pixmap, prop, 4);
+ XFree (prop);
+ fill = False;
+ }
+ else
+ {
+ pixmap = XCreatePixmap (dpy, root, 1, 1, DefaultDepth (dpy, scr));
+ fill = True;
+ }
+ pa.repeat = True;
+ picture = XRenderCreatePicture (dpy, pixmap,
+ XRenderFindVisualFormat (dpy,
+ DefaultVisual (dpy, scr)),
+ CPRepeat, &pa);
+ if (fill)
+ {
+ XRenderColor c;
+
+ c.red = c.green = c.blue = 0x8080;
+ c.alpha = 0xffff;
+ XRenderFillRectangle (dpy, PictOpSrc, picture, &c,
+ 0, 0, 1, 1);
+ }
+ return picture;
+}
+