add: XSync(dpy, False);
context: wColormapInstallForWindow(WScreen *scr, WWindow *wwin){    int i;    XWindowAttributes attributes;    int done = 0;    Window xwin = None;    if(wwin) {	xwin = wwin->client_win;    } else {	xwin = scr->root_win;    }    scr->cmap_window = wwin;    if (scr->root_colormap_install_count > 0) {	scr->original_cmap_window = wwin;	return;    }    /* install colormap for all windows of the client */    if (wwin && wwin->cmap_window_no > 0) {	for (i = wwin->cmap_window_no - 1; i >= 0; i--) {	    Window w;	    w = wwin->cmap_windows[i];	    if (w == wwin->client_win)		done = 1;	    XGetWindowAttributes(dpy, w, &attributes);	    if (attributes.colormap == None)		attributes.colormap = scr->colormap;	    if (scr->current_colormap != attributes.colormap) {		scr->current_colormap = attributes.colormap;		XInstallColormap(dpy, attributes.colormap);    	    }	}    }    if (!done) {	XGetWindowAttributes(dpy, xwin, &attributes);	if (attributes.colormap == None)	    attributes.colormap = scr->colormap;	if (scr->current_colormap != attributes.colormap) {	    scr->current_colormap = attributes.colormap;	    XInstallColormap(dpy, attributes.colormap);    	}    }}