From: Michael D. Lowis Date: Wed, 14 Aug 2019 15:03:17 +0000 (-0400) Subject: fixed bug in titlebar redrawing code X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=edc66a2f73e5e7832ac71dabee9a09b635c317bf;p=projs%2Ftide.git fixed bug in titlebar redrawing code --- diff --git a/src/anvil.c b/src/anvil.c index e5fbe89..581a3cc 100644 --- a/src/anvil.c +++ b/src/anvil.c @@ -15,7 +15,7 @@ ((x)->font->height + 3) enum { - TOO_SMALL = (1 << 0) + TOO_SMALL = (1 << 0), }; typedef struct Client { @@ -27,11 +27,19 @@ typedef struct Client { int flags, x, y, w, h; } Client; +typedef struct Column { + struct Column *next; + struct Client* clients; + int flags, x, w; +} Column; + XConf X = {0}; Client* Clients = NULL; Cursor Move_Cursor; int StartY = 0; +Column* Columns = NULL; + /* configuration */ uint32_t BorderWidth = 1; uint32_t BorderColor = 0xFF0000; @@ -160,11 +168,14 @@ Client* client_find(Window win) { void client_redraw(XConf* x, Client* c) { puts("redraw"); - XftColor clr; + XftColor fgclr, bgclr; if (!c->name) return; - xftcolor(x, &clr, -1); - XftDrawStringUtf8(c->xft, &clr, x->font, 0, x->font->ascent, (const FcChar8*)c->name, strlen(c->name)); - XftColorFree(x->display, x->visual, x->colormap, &clr); + xftcolor(x, &fgclr, -1); + xftcolor(x, &bgclr, BackgroundColor); + XftDrawRect(c->xft, &bgclr, 0, 0, c->w, BARHEIGHT(x)); + XftDrawStringUtf8(c->xft, &fgclr, x->font, 0, x->font->ascent, (const FcChar8*)c->name, strlen(c->name)); + XftColorFree(x->display, x->visual, x->colormap, &fgclr); + XftColorFree(x->display, x->visual, x->colormap, &bgclr); } void client_resize(XConf* x, Client* c, int dir) {