Layout: Add width reminder in layer layout.

This commit is contained in:
Martin Duquesnoy 2009-10-12 20:41:34 +02:00
parent b45b14dcd0
commit 3fa21c0d2e

View File

@ -635,17 +635,20 @@ layer(int screen)
int n, i, l = tags[screen][seltag[screen]].layers;
int *x = NULL;
int *nl = NULL;
int *ncl = NULL;
for(n = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++n);
CHECK(n);
x = emalloc(l + 1, sizeof(int));
nl = emalloc(l + 1, sizeof(int));
ncl = emalloc(l + 1, sizeof(int));
for(i = 0; i < l + 1; ++i)
{
x[i] = sg.x;
nl[i] = 0;
ncl[i] = 0;
}
for(c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next))
@ -660,6 +663,8 @@ layer(int screen)
c->flags &= ~(MaxFlag | LMaxFlag);
c->flags |= TileFlag;
++ncl[c->layer];
geo.x = x[c->layer];
geo.height = (sg.height / l) - (BORDH + TBARH);
geo.width = (sg.width / ((nl[c->layer]) ? nl[c->layer] : 1)) - BORDH * 2;
@ -668,6 +673,9 @@ layer(int screen)
if(c->layer == l)
geo.height = (sg.y + sg.height) - geo.y - BORDH;
if(ncl[c->layer] == nl[c->layer])
geo.width = sg.width - (geo.x - (sg.x - (BORDH * 2)));
client_moveresize(c, geo, False);
x[c->layer] = geo.x + geo.width + BORDH * 2;
@ -675,6 +683,7 @@ layer(int screen)
free(x);
free(nl);
free(ncl);
ewmh_update_current_tag_prop();