void stacked_add(Monitor* mon, Column* col, Client* c)
{
+ /* TODO: unshade when client before is is removed */
+ /* TODO: add floating client add function */
coldims(mon, col, &(c->x), &(c->y), &(c->w), &(c->h));
if (col->clients)
{
max = c;
}
}
- c->h = max->h/2;
- c->y = max->y + c->h;
- max->h -= max->h/2;
- c->next = max->next;
- max->next = c;
- client_adjust(c);
- client_adjust(max);
+ if (max->h < 3*MIN_HEIGHT)
+ {
+ if (col->next)
+ {
+ stacked_add(mon, col->next, c);
+ }
+ else
+ {
+ c->next = mon->cspace->floating;
+ mon->cspace->floating = c;
+ c->x = mon->midx - c->w/2;
+ c->y = mon->midy - c->h/2;
+ client_adjust(c);
+ }
+ }
+ else
+ {
+ c->h = max->h/2;
+ c->y = max->y + c->h;
+ max->h -= max->h/2;
+ c->next = max->next;
+ max->next = c;
+ client_adjust(c);
+ client_adjust(max);
+ }
}
else
{
{
col->clients->h += col->clients->y - mon->y;
col->clients->y = mon->y;
+ client_setshade(col->clients, 0);
client_adjust(col->clients);
}
}