From 3fa21c0d2e4ff699326852fb3209bd8599f26c58 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Mon, 12 Oct 2009 20:41:34 +0200 Subject: [PATCH] Layout: Add width reminder in layer layout. --- src/layout.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/layout.c b/src/layout.c index 3bfdea7..f74f2e3 100644 --- a/src/layout.c +++ b/src/layout.c @@ -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();