From 2d063d279ed768ed87736b4fa30bd2f7c005d2a2 Mon Sep 17 00:00:00 2001 From: id Date: Sat, 9 Dec 2000 12:16:35 +0000 Subject: [PATCH] fix fix --- plugins/libwmfun/drawstring.c | 6 ++++-- src/framewin.c | 38 ++++++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/plugins/libwmfun/drawstring.c b/plugins/libwmfun/drawstring.c index 4851a94d..ba02d376 100644 --- a/plugins/libwmfun/drawstring.c +++ b/plugins/libwmfun/drawstring.c @@ -188,7 +188,7 @@ WMFreeTypeRImage *renderChar(FT_Face face, FT_ULong char_index, RColor *color) { return tmp_data; } -/* drawFreetypeString */ +/* drawFreeTypeString */ void initDrawFreeTypeString(proplist_t pl, void **init_data) { WMFreeTypeData *data; XColor xcolor; @@ -330,6 +330,7 @@ drawFreeTypeString (proplist_t pl, Drawable d, if (!func_data[2]) { XGetGeometry(ds_dpy, d, &wdummy, &dummy, &dummy, &xwidth, &xheight, &dummy, &dummy); pixmap = XCreatePixmap(ds_dpy, d, xwidth, xheight, DefaultDepth(ds_dpy, DefaultScreen(ds_dpy))); + XClearWindow(ds_dpy, d); XCopyArea(ds_dpy, d, pixmap, gc, 0, 0, xwidth, xheight, 0, 0); rimg = RCreateImageFromDrawable(rc, pixmap, None); XFreePixmap(ds_dpy, pixmap); @@ -348,7 +349,8 @@ drawFreeTypeString (proplist_t pl, Drawable d, int _dx, _dy, _sw, _sh; _dx = j + data->glyphs_array[text[i]]->left; - _dy = (height + data->face->size->metrics.y_ppem)/2 - data->glyphs_array[text[i]]->top; + _dy = (height + data->face->size->metrics.y_ppem)/2 - + data->glyphs_array[text[i]]->top; _sw = data->glyphs_array[text[i]]->image->width; _sh = data->glyphs_array[text[i]]->image->height; diff --git a/src/framewin.c b/src/framewin.c index d1b76715..67cc36d9 100644 --- a/src/framewin.c +++ b/src/framewin.c @@ -986,21 +986,28 @@ wFrameWindowPaint(WFrameWindow *fwin) if (fwin->titlebar && !fwin->flags.repaint_only_resizebar && fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) { #ifdef DRAWSTRING_PLUGIN - 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); - wDrawBevel(tmp_bg, fwin->titlebar->width, - fwin->titlebar->height, - (WTexSolid*)fwin->title_texture[fwin->flags.state], - WREL_RAISED); - background = &tmp_bg; + 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); + wDrawBevel(tmp_bg, fwin->titlebar->width, + fwin->titlebar->height, + (WTexSolid*)fwin->title_texture[fwin->flags.state], + WREL_RAISED); + background = &tmp_bg; + } else { + 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); + wDrawBevel(fwin->titlebar->window, fwin->titlebar->width, + fwin->titlebar->height, + (WTexSolid*)fwin->title_texture[fwin->flags.state], + WREL_RAISED); #endif } #ifdef DRAWSTRING_PLUGIN @@ -1131,8 +1138,7 @@ wFrameWindowPaint(WFrameWindow *fwin) title, titlelen); } - if (fwin->titlebar && !fwin->flags.repaint_only_resizebar - && fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) { + if (fwin->title && fwin->title_texture[fwin->flags.state]->any.type==WTEX_SOLID) { XFreePixmap(dpy, tmp_bg); } #undef DRAWSTRING_CURRENT_STATE -- 2.11.4.GIT