JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
implemented fallback for too many clients in stacked mode
[dwm.git] / client.c
index 62d4afc..52e623a 100644 (file)
--- a/client.c
+++ b/client.c
@@ -201,16 +201,17 @@ 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 = sx + (random() % diff ? diff : 1);
-       diff = sh - c->fh;
-       c->fy = sx + (random() % diff ? diff : 1);
+       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);