From 7654abcedc4f42a6dabb399d5a5915e0dc69c715 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 18 Apr 2016 01:27:50 -0400 Subject: [PATCH] layout.tile: Avoid negative geometries --- lib/awful/layout/suit/tile.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/awful/layout/suit/tile.lua b/lib/awful/layout/suit/tile.lua index 802fdce97..fce17e01c 100644 --- a/lib/awful/layout/suit/tile.lua +++ b/lib/awful/layout/suit/tile.lua @@ -171,7 +171,7 @@ local function tile_group(gs, cls, wa, orientation, fact, group) end total_fact = total_fact + fact[i] end - size = math.min(size, available) + size = math.max(1, math.min(size, available)) local coord = wa[y] local used_size = 0 @@ -181,7 +181,7 @@ local function tile_group(gs, cls, wa, orientation, fact, group) local hints = {} local i = c - group.first +1 geom[width] = size - geom[height] = math.floor(unused * fact[i] / total_fact) + geom[height] = math.max(1, math.floor(unused * fact[i] / total_fact)) geom[x] = group.coord geom[y] = coord gs[cls[c]] = geom