+ /* The window might have no-op background of None, so to clear it,
+ draw a black rectangle first, then do XClearWindow (in case the
+ actual background color is non-black...) */
+ {
+ XGCValues gcv;
+ GC gc;
+ /* #### really we should allocate "black" instead, but I'm lazy... */
+ gcv.foreground = BlackPixelOfScreen (screen);
+ gc = XCreateGC (dpy, window, GCForeground, &gcv);
+ XFillRectangle (dpy, window, gc, 0, 0, win_width, win_height);
+ XFreeGC (dpy, gc);
+ XClearWindow (dpy, window);
+ XFlush (dpy);
+ }
+