X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=client.c;h=91d031ee53bed55e6e4177907265b742048ab78b;hb=99b126d0afe461960d001385c9ee13295c8ed543;hp=f4ed1a067f860bc95c215919cc82a35a7d2cdbf2;hpb=8cc7f3bace087dfb024a23115c211d82b35614ae;p=dwm.git diff --git a/client.c b/client.c index f4ed1a0..91d031e 100644 --- a/client.c +++ b/client.c @@ -16,7 +16,7 @@ resizetitle(Client *c) int i; c->tw = 0; - for(i = 0; i < TLast; i++) + for(i = 0; i < ntags; i++) if(c->tags[i]) c->tw += textw(tags[i]); c->tw += textw(c->name); @@ -211,6 +211,7 @@ manage(Window w, XWindowAttributes *wa) XSetWindowAttributes twa; c = emallocz(sizeof(Client)); + c->tags = emallocz(ntags * sizeof(Bool)); c->win = w; c->x = c->tx = wa->x; c->y = c->ty = wa->y; @@ -429,6 +430,7 @@ unmanage(Client *c) if(!sel) sel = clients; } + free(c->tags); free(c); XSync(dpy, False);