rem: if (flags & WFF_THAI_BUTTON) { fwin->flags.thai_button = 1;
add: if (flags & WFF_XKB_BUTTON) { fwin->flags.language_button = 1;
context: wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags){    int theight;    int bsize;    int width, height;    int i;    WScreen *scr = fwin->screen_ptr;    width = fwin->core->width;    if (flags & WFF_IS_SHADED)	height = -1;    else	height = fwin->core->height - fwin->top_width - fwin->bottom_width;    if (flags & WFF_TITLEBAR)	theight = (*fwin->font)->height + TITLEBAR_EXTRA_HEIGHT;    else	theight = 0;        if (wPreferences.new_style) {	bsize = theight;    } else {	bsize = theight - 7;    }        if (fwin->titlebar) {	/* if we had a titlebar and is requesting for one,	 * check if the size has changed and resize it */	if (flags & WFF_TITLEBAR) {	    fwin->top_width = theight;	    fwin->flags.need_texture_remake = 1;	    	    if (wPreferences.new_style) {		if (fwin->left_button) {		    wCoreConfigure(fwin->left_button, 0, 0, bsize, bsize);		}#ifdef XKB_BUTTON_HINT		if (fwin->thai_button)        if (fwin->flags.hide_left_button || !fwin->left_button            || fwin->flags.lbutton_dont_fit) {		    wCoreConfigure(fwin->thai_button, 0, 0, bsize, bsize);        } else {		    wCoreConfigure(fwin->thai_button, bsize, 0, bsize, bsize);        }#endif				if (fwin->right_button) {		    wCoreConfigure(fwin->right_button, width-bsize+1,				   0, bsize, bsize);		}	    } else { /* !new_style */		if (fwin->left_button) {		    wCoreConfigure(fwin->left_button, 3, (theight-bsize)/2,				   bsize, bsize);		}        #ifdef XKB_BUTTON_HINT		if (fwin->thai_button) {            wCoreConfigure(fwin->thai_button, 6 + bsize, (theight-bsize)/2,                    bsize, bsize);        }#endif				if (fwin->right_button) {		    wCoreConfigure(fwin->right_button, width-bsize-3,				   (theight-bsize)/2, bsize, bsize);		}	    }	    updateTitlebar(fwin);	} else {	    /* we had a titlebar, but now we don't need it anymore */	    for (i=0; i < (fwin->flags.single_texture ? 1 : 3); i++) {            FREE_PIXMAP(fwin->title_back[i]);            if (wPreferences.new_style) {                FREE_PIXMAP(fwin->lbutton_back[i]);                FREE_PIXMAP(fwin->rbutton_back[i]);#ifdef XKB_BUTTON_HINT                FREE_PIXMAP(fwin->tbutton_back[i]);#endif            }	    }	    if (fwin->left_button)		wCoreDestroy(fwin->left_button);	    fwin->left_button = NULL;	    #ifdef XKB_BUTTON_HINT        if (fwin->thai_button)            wCoreDestroy(fwin->thai_button);        fwin->thai_button = NULL;#endif	    if (fwin->right_button)		wCoreDestroy(fwin->right_button);	    fwin->right_button = NULL;	    	    wCoreDestroy(fwin->titlebar);	    fwin->titlebar = NULL;	    	    fwin->top_width = 0;	}    } else {	/* if we didn't have a titlebar and are being requested for	 * one, create it */	if (flags & WFF_TITLEBAR) {			    fwin->top_width = theight;	    	    fwin->flags.titlebar = 1;	    fwin->titlebar = wCoreCreate(fwin->core, 0, 0, width+1, theight);	    	    if (flags & WFF_LEFT_BUTTON) {            fwin->flags.left_button = 1;            if (wPreferences.new_style) {                fwin->left_button = wCoreCreate(fwin->core, 0, 0,                        bsize, bsize);                if (width < theight*4) {                    fwin->flags.lbutton_dont_fit = 1;                } else {                    XMapRaised(dpy, fwin->left_button->window);                }            } else {                fwin->left_button =                     wCoreCreate(fwin->titlebar, 3, (theight-bsize)/2,                            bsize, bsize);                XSetWindowBackground(dpy, fwin->left_button->window,                        scr->widget_texture->normal.pixel);                if (width < theight*3) {                    fwin->flags.lbutton_dont_fit = 1;                } else {                    XMapRaised(dpy, fwin->left_button->window);                }            }	    }        #ifdef XKB_BUTTON_HINT	    if (flags & WFF_THAI_BUTTON) {            fwin->flags.thai_button = 1;            if (wPreferences.new_style) {                fwin->thai_button = wCoreCreate(fwin->core,                        bsize, 0, bsize, bsize);                if (width < theight*4) {                    fwin->flags.tbutton_dont_fit = 1;                } else {                    XMapRaised(dpy, fwin->thai_button->window);                }            } else {                fwin->thai_button =                     wCoreCreate(fwin->titlebar, bsize + 6, (theight-bsize)/2,				    bsize, bsize);                                 XSetWindowBackground(dpy, fwin->thai_button->window,					 scr->widget_texture->normal.pixel);                 if (width < theight*3) {                    fwin->flags.tbutton_dont_fit = 1;                } else {                    XMapRaised(dpy, fwin->thai_button->window);                }            }	    }#endif	    	    if (flags & WFF_RIGHT_BUTTON) {		fwin->flags.right_button = 1;                if (wPreferences.new_style) {		    fwin->right_button =			wCoreCreate(fwin->core, width-bsize+1, 0,				    bsize, bsize);                } else {		    fwin->right_button =			wCoreCreate(fwin->titlebar, width-bsize-3,				    (theight-bsize)/2, bsize, bsize);		    XSetWindowBackground(dpy, fwin->right_button->window,					 scr->widget_texture->normal.pixel);                }				if (width < theight*2) {		    fwin->flags.rbutton_dont_fit = 1;		} else {		    XMapRaised(dpy, fwin->right_button->window);		}	    }	                if (wPreferences.new_style)		updateTitlebar(fwin);	    XMapRaised(dpy, fwin->titlebar->window);	    fwin->flags.need_texture_remake = 1;	}    }    checkTitleSize(fwin);    if (flags & WFF_RESIZEBAR) {	fwin->bottom_width = RESIZEBAR_HEIGHT;    } else {	fwin->bottom_width = 0;    }         if (flags & WFF_RESIZEBAR) {	if (!fwin->resizebar) {	    fwin->flags.resizebar = 1;	    fwin->resizebar = wCoreCreate(fwin->core, 0,					  height + fwin->top_width,					  width, RESIZEBAR_HEIGHT);	    fwin->resizebar_corner_width = RESIZEBAR_CORNER_WIDTH;	    if (width < RESIZEBAR_CORNER_WIDTH*2 + RESIZEBAR_MIN_WIDTH) {		fwin->resizebar_corner_width = (width - RESIZEBAR_MIN_WIDTH)/2;		if (fwin->resizebar_corner_width < 0)		    fwin->resizebar_corner_width = 0;	    }	    	    XMapWindow(dpy, fwin->resizebar->window);	    XLowerWindow(dpy, fwin->resizebar->window);	    	    fwin->flags.need_texture_remake = 1;	} else {	    if (height+fwin->top_width+fwin->bottom_width != fwin->core->height) {		wCoreConfigure(fwin->resizebar, 0, height + fwin->top_width,			       width, RESIZEBAR_HEIGHT);	    }	}    } else {	if (fwin->resizebar) {	    fwin->bottom_width = 0;	    wCoreDestroy(fwin->resizebar);	    fwin->resizebar = NULL;	}    }    if (height + fwin->top_width + fwin->bottom_width != fwin->core->height	&& !(flags & WFF_IS_SHADED)) {	wFrameWindowResize(fwin, width,			   height + fwin->top_width + fwin->bottom_width);    }        /* setup object descriptors */        if (fwin->titlebar) {	fwin->titlebar->descriptor.handle_expose = handleExpose;	fwin->titlebar->descriptor.parent = fwin;	fwin->titlebar->descriptor.parent_type = WCLASS_FRAME;	fwin->titlebar->descriptor.handle_mousedown = titlebarMouseDown;    }        if (fwin->resizebar) {	fwin->resizebar->descriptor.handle_expose = handleExpose;	fwin->resizebar->descriptor.parent = fwin;	fwin->resizebar->descriptor.parent_type = WCLASS_FRAME;	fwin->resizebar->descriptor.handle_mousedown = resizebarMouseDown;    }        if (fwin->left_button) {	fwin->left_button->descriptor.handle_expose = handleButtonExpose;	fwin->left_button->descriptor.parent = fwin;	fwin->left_button->descriptor.parent_type = WCLASS_FRAME;	fwin->left_button->descriptor.handle_mousedown = buttonMouseDown;    }    #ifdef XKB_BUTTON_HINT    if (fwin->thai_button) {	fwin->thai_button->descriptor.handle_expose = handleButtonExpose;	fwin->thai_button->descriptor.parent = fwin;	fwin->thai_button->descriptor.parent_type = WCLASS_FRAME;	fwin->thai_button->descriptor.handle_mousedown = buttonMouseDown;    }#endif        if (fwin->right_button) {	fwin->right_button->descriptor.parent = fwin;	fwin->right_button->descriptor.parent_type = WCLASS_FRAME;	fwin->right_button->descriptor.handle_expose = handleButtonExpose;	fwin->right_button->descriptor.handle_mousedown = buttonMouseDown;    }        checkTitleSize(fwin);}