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);
*c->w = c->maxw;
if(c->maxh && *c->h > c->maxh)
*c->h = c->maxh;
- if(sticky == TopRight || sticky == BottomRight)
+ if(sticky == TopRight || sticky == BotRight)
*c->x = right - *c->w;
- if(sticky == BottomLeft || sticky == BottomRight)
+ if(sticky == BotLeft || sticky == BotRight)
*c->y = bottom - *c->h;
resizetitle(c);
XSetWindowBorderWidth(dpy, c->win, 1);