+// adapted from wmsetbg
+Pixmap bsetroot::duplicatePixmap(int screen, Pixmap pixmap,
+ int width, int height) {
+ XSync(getXDisplay(), False);
+
+ Pixmap copyP = XCreatePixmap(getXDisplay(),
+ getScreenInfo(screen)->getRootWindow(),
+ width, height,
+ DefaultDepth(getXDisplay(), screen));
+ XCopyArea(getXDisplay(), pixmap, copyP, DefaultGC(getXDisplay(), screen),
+ 0, 0, width, height, 0, 0);
+ XSync(getXDisplay(), False);