From 8d8804221ba2c2d854fc1dd12e8bdd5e4e4d9074 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 12 Dec 2009 21:42:56 +0100 Subject: [PATCH] Partly revert 4ba26659, it was just wrong. --- src/layout.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/layout.c b/src/layout.c index 80707319..98c270b7 100644 --- a/src/layout.c +++ b/src/layout.c @@ -463,7 +463,7 @@ void render_container(xcb_connection_t *conn, Container *container) { if (container->stack_limit == STACK_LIMIT_COLS) { /* wrap stores the number of rows after which we will * wrap to a new column. */ - wrap = container->stack_limit_value; + wrap = ceil((float)num_clients / container->stack_limit_value); } else if (container->stack_limit == STACK_LIMIT_ROWS) { /* When limiting rows, the wrap variable serves a * slightly different purpose: it holds the number of @@ -500,10 +500,10 @@ void render_container(xcb_connection_t *conn, Container *container) { if (container->stack_limit == STACK_LIMIT_COLS) { offset_x = current_col * (stack_win->rect.width / container->stack_limit_value); offset_y = current_row * decoration_height; - current_col++; - if ((current_col % wrap) == 0) { - current_row++; - current_col = 0; + current_row++; + if ((current_row % wrap) == 0) { + current_col++; + current_row = 0; } } else if (container->stack_limit == STACK_LIMIT_ROWS) { offset_x = current_col * wrap; -- 2.39.5