From 1584a32063cd252ec726dd18747c5f91f12f8be9 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Thu, 9 Jul 2020 16:04:04 +0200 Subject: [PATCH] flextile deluxe: fixed dual stack bug --- patch/flextile-deluxe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patch/flextile-deluxe.c b/patch/flextile-deluxe.c index c8b7e3e..a877c92 100644 --- a/patch/flextile-deluxe.c +++ b/patch/flextile-deluxe.c @@ -504,7 +504,7 @@ arrange_gapplessgrid_alt1(Monitor *m, int x, int y, int h, int w, int ih, int iv rest = (h - ih * (rows - 1)) - ch * rows; for (i = 0; i < rows; i++) { - arrange_left_to_right(m, x, y, ch + (i < rest ? 1 : 0), w, ih, iv, n, cols, ai + i*cols); + arrange_left_to_right(m, x, y, ch + (i < rest ? 1 : 0), w, ih, iv, n, MIN(cols, an - i*cols), ai + i*cols); y += ch + (i < rest ? 1 : 0) + ih; } } @@ -524,7 +524,7 @@ arrange_gapplessgrid_alt2(Monitor *m, int x, int y, int h, int w, int ih, int iv rest = (w - iv * (cols - 1)) - cw * cols; for (i = 0; i < cols; i++) { - arrange_top_to_bottom(m, x, y, h, cw + (i < rest ? 1 : 0), ih, iv, n, rows, ai + i*rows); + arrange_top_to_bottom(m, x, y, h, cw + (i < rest ? 1 : 0), ih, iv, n, MIN(rows, an - i*rows), ai + i*rows); x += cw + (i < rest ? 1 : 0) + iv; } }