-       dc.drawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen));
-       dc.gc = XCreateGC(dpy, root, 0, 0);
+       wa.override_redirect = 1;
+       wa.background_pixmap = ParentRelative;
+       wa.event_mask = ButtonPressMask | ExposureMask;
+
+       bx = by = 0;
+       bw = sw;
+       dc.h = bh = dc.font.height + 4;
+       barwin = XCreateWindow(dpy, root, bx, by, bw, bh, 0, DefaultDepth(dpy, screen),
+                       CopyFromParent, DefaultVisual(dpy, screen),
+                       CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
+       XDefineCursor(dpy, barwin, cursor[CurNormal]);
+       XMapRaised(dpy, barwin);
+
+       issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);