X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=client.c;h=52e623ad4cc3a20a9c67568af821ab38de0f1296;hb=79cd408844c62963aa0eec45bb0414ed66f06f6f;hp=af2c2497f1f65af3c176c2e7bcbcd818ec30f3cf;hpb=c53980cddcee8afd13ea793134ed3ddf5dbef0e3;p=dwm.git diff --git a/client.c b/client.c index af2c249..52e623a 100644 --- a/client.c +++ b/client.c @@ -192,6 +192,7 @@ lower(Client *c) void manage(Window w, XWindowAttributes *wa) { + int diff; Client *c; XSetWindowAttributes twa; Window trans; @@ -200,11 +201,18 @@ manage(Window w, XWindowAttributes *wa) c->win = w; c->bx = c->fx = c->tx = wa->x; c->by = c->fy = c->ty = wa->y; - if(c->fy < bh) - c->by = c->fy = c->ty += bh; c->bw = c->fw = c->tw = wa->width; c->fh = c->th = wa->height; c->bh = bh; + + diff = sw - c->fw; + c->fx = random() % (diff ? diff : 1); + diff = sh - c->fh - bh; + c->fy = random() % (diff ? diff : 1); + + if(c->fy < bh) + c->by = c->fy = c->ty = bh; + c->border = 1; c->proto = getproto(c->win); setsize(c);