add: if (fwin->title && fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) { XCopyArea(dpy, tmp_bg, fwin->titlebar->window, *fwin->title_gc, 0, 0, fwin->titlebar->width, tb, 0, 0); }
context: wFrameWindowPaint(WFrameWindow *fwin){    WScreen *scr = fwin->screen_ptr;#ifdef DRAWSTRING_PLUGIN#define DRAWSTRING_CURRENT_STATE fwin->flags.state + fwin->drawstring_proc_offset    Pixmap *background;    Pixmap tmp_bg;    int tb = fwin->top_width;    WPluginData *pd;#endif    if (fwin->flags.is_client_window_frame)	fwin->flags.justification = wPreferences.title_justification;    if (fwin->flags.need_texture_remake) {	int i;	fwin->flags.need_texture_remake = 0;	fwin->flags.need_texture_change = 0;	if (fwin->flags.single_texture) {	    remakeTexture(fwin, 0);	    updateTexture(fwin);	} else {	    /* first render the texture for the current state... */	    remakeTexture(fwin, fwin->flags.state);	    /* ... and paint it */	    updateTexture(fwin);	    for (i=0; i < 3; i++) {		if (i!=fwin->flags.state)		    remakeTexture(fwin, i);	    }	}    }        if (fwin->flags.need_texture_change) {		fwin->flags.need_texture_change = 0;		updateTexture(fwin);    }    if (fwin->titlebar && !fwin->flags.repaint_only_resizebar	&& fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) {#ifdef DRAWSTRING_PLUGIN        if (fwin->title) {            tmp_bg = XCreatePixmap(dpy, fwin->titlebar->window,                    fwin->titlebar->width, tb,                    DefaultDepth(dpy, DefaultScreen(dpy)));            XFillRectangle(dpy, tmp_bg, (*fwin->title_texture)->solid.normal_gc,                    0, 0, fwin->titlebar->width, tb);            printf("bevel 1 %s\n", fwin->title);            wDrawBevel(tmp_bg, fwin->titlebar->width,                    fwin->titlebar->height,                    (WTexSolid*)fwin->title_texture[fwin->flags.state],                     WREL_RAISED);            XDrawLine(dpy, tmp_bg, fwin->resizebar_texture[0]->dim_gc, 0, 0, w, tb);            background = &tmp_bg;        } else {            printf("bevel 2\n");            wDrawBevel(fwin->titlebar->window, fwin->titlebar->width,                    fwin->titlebar->height,                    (WTexSolid*)fwin->title_texture[fwin->flags.state],                     WREL_RAISED);        }#else        wDrawBevel(fwin->titlebar->window, fwin->titlebar->width,                fwin->titlebar->height,                (WTexSolid*)fwin->title_texture[fwin->flags.state],                 WREL_RAISED);#endif    }#ifdef DRAWSTRING_PLUGIN    else background = &fwin->title_back[fwin->flags.state];#endif    if (fwin->resizebar	&& !fwin->flags.repaint_only_titlebar	&& fwin->resizebar_texture[0]->any.type == WTEX_SOLID) {	Window win;	int w, h;	int cw;	GC light_gc, dim_gc;	WTexSolid *texture = (WTexSolid*)fwin->resizebar_texture[0];	w = fwin->resizebar->width;	h = fwin->resizebar->height;	cw = fwin->resizebar_corner_width;	light_gc = texture->light_gc;	dim_gc = texture->dim_gc;	win = fwin->resizebar->window;	XDrawLine(dpy, win, dim_gc, 0, 0, w, 0);	XDrawLine(dpy, win, light_gc, 0, 1, w, 1);		XDrawLine(dpy, win, dim_gc, cw, 2, cw, h);	XDrawLine(dpy, win, light_gc, cw+1, 2, cw+1, h);		XDrawLine(dpy, win, dim_gc, w-cw-2, 2, w-cw-2, h);	XDrawLine(dpy, win, light_gc, w-cw-1, 2, w-cw-1, h);	#ifdef SHADOW_RESIZEBAR	XDrawLine(dpy, win, light_gc, 0, 1, 0, h-1);	XDrawLine(dpy, win, dim_gc, w-1, 2, w-1, h-1);	XDrawLine(dpy, win, dim_gc, 1, h-1, cw, h-1);	XDrawLine(dpy, win, dim_gc, cw+2, h-1, w-cw-2, h-1);	XDrawLine(dpy, win, dim_gc, w-cw, h-1, w-1, h-1);#endif /* SHADOW_RESIZEBAR */    }            if (fwin->title && fwin->titlebar && !fwin->flags.repaint_only_resizebar) {        int x, w;        int lofs = 6, rofs = 6;        int titlelen;        char *title;        int allButtons = 1;        if (!wPreferences.new_style) {	    if (fwin->left_button && !fwin->flags.hide_left_button		&& !fwin->flags.lbutton_dont_fit)		lofs += fwin->left_button->width + 3;	    else		allButtons = 0;#ifdef XKB_BUTTON_HINT	    if (fwin->language_button && !fwin->flags.hide_language_button		&& !fwin->flags.languagebutton_dont_fit)		lofs += fwin->language_button->width;	    else		allButtons = 0;#endif	    	    if (fwin->right_button && !fwin->flags.hide_right_button		&& !fwin->flags.rbutton_dont_fit)		rofs += fwin->right_button->width + 3;	    else		allButtons = 0;        }#ifdef XKB_BUTTON_HINT        fwin->languagebutton_image =            scr->b_pixmaps[WBUT_XKBGROUP1 + fwin->languagemode];#endif#ifdef DRAWSTRING_PLUGIN    if(scr->drawstring_func[DRAWSTRING_CURRENT_STATE]) {        title = ShrinkString(*fwin->font, fwin->title,                fwin->titlebar->width - lofs - rofs,                scr->drawstring_func[DRAWSTRING_CURRENT_STATE]);        titlelen = strlen(title);        pd = wPluginPackData(1, scr->drawstring_func[DRAWSTRING_CURRENT_STATE]->data);        scr->drawstring_func[DRAWSTRING_CURRENT_STATE]->proc.widthOfString[W_DSPROC_WIDTHOFSTRING](                title, titlelen, pd, &w, NULL, NULL);        wfree(pd);    } else {        title = ShrinkString(*fwin->font, fwin->title,                fwin->titlebar->width - lofs - rofs, NULL);        titlelen = strlen(title);        w = WMWidthOfString(*fwin->font, title, titlelen);    }#else	title = ShrinkString(*fwin->font, fwin->title,			     fwin->titlebar->width - lofs - rofs);	titlelen = strlen(title);	w = WMWidthOfString(*fwin->font, title, titlelen);#endif	switch (fwin->flags.justification) {	 case WTJ_LEFT:	    x = lofs;	    break;	 case WTJ_RIGHT:	    x = fwin->titlebar->width - w - rofs;	    break;	 default:	    if (!allButtons)		x = lofs + (fwin->titlebar->width - w - lofs - rofs) / 2;	    else		x = (fwin->titlebar->width - w) / 2;	    break;	}	XSetForeground(dpy, *fwin->title_gc, 		       fwin->title_pixel[fwin->flags.state]);	#ifdef DRAWSTRING_PLUGIN    /* if the plugin want to do shrinking locally, they can trick    * wmaker by returning a very short value (such as 0) to widthOfString -- I think */    if (scr->drawstring_func[DRAWSTRING_CURRENT_STATE]) {        pd = wPluginPackData(6,      /* number of argument, will be passed */                scr->drawstring_func[DRAWSTRING_CURRENT_STATE]->data,                                    /* 0 plugin data, as it was initialized */                background,         /* 1 current background Pixmap */                fwin->title_gc,     /* 2 gc */                *fwin->font,        /* 3 WMFont** */                &fwin->titlebar->width,                                    /* 4 suggested width */                &tb                 /* 5 suggested height */                );        scr->drawstring_func[DRAWSTRING_CURRENT_STATE]->proc.drawString[W_DSPROC_DRAWSTRING](                scr->drawstring_func[DRAWSTRING_CURRENT_STATE]->arg,                fwin->titlebar->window,                x, 0,                 title, strlen(fwin->title), pd);        wfree(pd);    } else {        WMDrawString(scr->wmscreen, fwin->titlebar->window,                 *fwin->title_gc, *fwin->font,                x, ((signed)fwin->top_width - (signed)WMFontHeight(*fwin->font))/2,                 title, titlelen);    }    if (fwin->title && fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) {        XFreePixmap(dpy, tmp_bg);    }#undef DRAWSTRING_CURRENT_STATE#else    WMDrawString(scr->wmscreen, fwin->titlebar->window,             *fwin->title_gc, *fwin->font, x, *fwin->title_clearance + TITLEBAR_EXTEND_SPACE,             title, titlelen);#endif /* DRAWSTRING_PLUGIN */	wfree(title);		if (fwin->left_button)	    handleButtonExpose(&fwin->left_button->descriptor, NULL);	if (fwin->right_button)	    handleButtonExpose(&fwin->right_button->descriptor, NULL);#ifdef XKB_BUTTON_HINT	if (fwin->language_button)	    handleButtonExpose(&fwin->language_button->descriptor, NULL);#endif     }}