From: Michael D. Lowis Date: Thu, 15 Aug 2019 00:54:07 +0000 (-0400) Subject: called redraw in more places X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=126a0bbe4e6e13091f60acd54910b0995d4a0957;p=projs%2Ftide.git called redraw in more places --- diff --git a/src/anvil.c b/src/anvil.c index 6a57bed..39a0899 100644 --- a/src/anvil.c +++ b/src/anvil.c @@ -94,6 +94,18 @@ void client_del(Client* c) { if (Clients == c) Clients = c->next; } +void client_redraw(XConf* x, Client* c) { + puts("redraw"); + XftColor fgclr, bgclr; + if (!c->name) return; + 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_reconfig(XConf* xs, Client* c) { int height = BARHEIGHT(xs); XMoveResizeWindow(xs->display, c->frame, c->x, c->y, c->w - 2, height); @@ -107,12 +119,14 @@ void client_reconfig(XConf* xs, Client* c) { XMapWindow(xs->display, c->win); } } + client_redraw(xs, c); XSync(xs->display, False); } void client_config(XConf* xs, Client* c, int x, int y, int w, int h) { c->x = x, c->y = y, c->w = w, c->h = h; client_reconfig(xs, c); + client_redraw(xs, c); } void client_raise(XConf* x, Client* c) { @@ -195,6 +209,7 @@ void client_create(XConf* x, Window win) { Floating = c; } client_config(x, c, c->x, c->y, c->w, c->h); + client_redraw(x, c); client_raise(x, c); XSync(x->display, False); @@ -223,18 +238,6 @@ Client* client_find(Window win) { return NULL; } -void client_redraw(XConf* x, Client* c) { - puts("redraw"); - XftColor fgclr, bgclr; - if (!c->name) return; - 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) { if (!c->prev) return; Client* prev = c->prev;