]> git.mdlowis.com Git - projs/tide.git/commitdiff
called redraw in more places
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 15 Aug 2019 00:54:07 +0000 (20:54 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 15 Aug 2019 00:54:07 +0000 (20:54 -0400)
src/anvil.c

index 6a57bed0de39017f2b119f671ebb3168ab535a41..39a0899e8452c1cdd7373b74d1d98d24a382c4b6 100644 (file)
@@ -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;