rem: if (fwin->flags.need_texture_change) { int i; unsigned long pixel;
add: if (fwin->flags.need_texture_change) {
context: wFrameWindowPaint(WFrameWindow *fwin){    if (fwin->flags.is_client_window_frame)	fwin->flags.justification = wPreferences.title_justification;    if (fwin->flags.need_texture_remake) {	int i;	Pixmap pmap, lpmap, rpmap;	fwin->flags.need_texture_remake = 0;	for (i=0; i < (fwin->flags.single_texture ? 1 : 3); i++) {	    if (fwin->title_texture[i] && fwin->titlebar) {		FREE_PIXMAP(fwin->title_back[i]);                if (wPreferences.new_style) {		    FREE_PIXMAP(fwin->lbutton_back[i]);		    FREE_PIXMAP(fwin->rbutton_back[i]);                }		if (fwin->title_texture[i]->any.type!=WTEX_SOLID) {		    int left, right;		    int width;                    /* eventually surrounded by if new_style */		    left = fwin->left_button && !fwin->flags.hide_left_button			&& !fwin->flags.lbutton_dont_fit;		    right = fwin->right_button && !fwin->flags.hide_right_button			&& !fwin->flags.rbutton_dont_fit;		    width = fwin->core->width+1;		    		    renderTexture(fwin->screen_ptr, fwin->title_texture[i],                                  width, fwin->titlebar->height,				  fwin->titlebar->height, fwin->titlebar->height,				  left, right, &pmap, &lpmap, &rpmap);		    fwin->title_back[i] = pmap;                    if (wPreferences.new_style) {			fwin->lbutton_back[i] = lpmap;			fwin->rbutton_back[i] = rpmap;		    }		}	    }	}		fwin->flags.need_texture_change = 1;    }        if (fwin->flags.need_texture_change) {	int i;	unsigned long pixel;		fwin->flags.need_texture_change = 0;		i = fwin->flags.state;	if (fwin->titlebar) {	    if (fwin->title_texture[i]->any.type!=WTEX_SOLID) {		XSetWindowBackgroundPixmap(dpy, fwin->titlebar->window,					   fwin->title_back[i]);                if (wPreferences.new_style) {		    if (fwin->left_button && fwin->lbutton_back[i])                        XSetWindowBackgroundPixmap(dpy,                                                   fwin->left_button->window,						   fwin->lbutton_back[i]);		    		    if (fwin->right_button && fwin->rbutton_back[i])                        XSetWindowBackgroundPixmap(dpy,                                                   fwin->right_button->window,						   fwin->rbutton_back[i]);                }	    } else {		pixel = fwin->title_texture[i]->solid.normal.pixel;		XSetWindowBackground(dpy, fwin->titlebar->window, pixel);                if (wPreferences.new_style) {		    if (fwin->left_button)                        XSetWindowBackground(dpy, fwin->left_button->window,                                             pixel);		    if (fwin->right_button)                        XSetWindowBackground(dpy, fwin->right_button->window,                                             pixel);                }	    }	    XClearWindow(dpy, fwin->titlebar->window);	    	    if (fwin->left_button) {		XClearWindow(dpy, fwin->left_button->window);		handleButtonExpose(&fwin->left_button->descriptor, NULL);	    }	    if (fwin->right_button) {		XClearWindow(dpy, fwin->right_button->window);		handleButtonExpose(&fwin->right_button->descriptor, NULL);	    }	}		if (fwin->resizebar) {	    XSetWindowBackground(dpy, fwin->resizebar->window, 				 fwin->resizebar_texture[0]->solid.normal.pixel);	    XClearWindow(dpy, fwin->resizebar->window);	}    }        if (fwin->titlebar && !fwin->flags.repaint_only_resizebar	&& fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) {	wDrawBevel(fwin->titlebar, 		   (WTexSolid*)fwin->title_texture[fwin->flags.state], 		   WREL_RAISED);    }        if (fwin->resizebar	&& !fwin->flags.repaint_only_titlebar) {	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;	    	    if (fwin->right_button && !fwin->flags.hide_right_button		&& !fwin->flags.rbutton_dont_fit)		rofs += fwin->right_button->width + 3;	    else		allButtons = 0;        }	title = ShrinkString(*fwin->font, fwin->title,			     fwin->titlebar->width - lofs - rofs);	titlelen = strlen(title);	w = wTextWidth((*fwin->font)->font, title, titlelen);	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]);		wDrawString(fwin->titlebar->window, *fwin->font,		    *fwin->title_gc, x, 		    (*fwin->font)->y + TITLEBAR_EXTRA_HEIGHT/2, title,		    titlelen);		free(title);    }}