From 8701792b8330222547fcc6df7cecae0f5e489660 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 5 Jun 2009 23:28:54 +0200 Subject: [PATCH] awful.wibox: honour user specified geometries If a wibox with non-north position was created and a wibox size was specified, this function happily ignored it when it made the wibox fit. Thanks to Garoth who found this bug. Signed-off-by: Uli Schlachter Signed-off-by: Julien Danjou --- lib/awful/wibox.lua.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/awful/wibox.lua.in b/lib/awful/wibox.lua.in index ad1f7839f..c419a5d94 100644 --- a/lib/awful/wibox.lua.in +++ b/lib/awful/wibox.lua.in @@ -247,14 +247,21 @@ function new(arg) -- Empty position and align in arg so we are passing deprecation warning arg.position = nil + -- Set default size + if position == "left" or position == "right" then + arg.width = arg.width or capi.awesome.font_height * 1.5 + arg.height = arg.height or 100 + else + arg.width = arg.width or 100 + arg.height = arg.height or capi.awesome.font_height * 1.5 + end + local w = capi.wibox(arg) if position == "left" then w.orientation = "north" - w:geometry({ width = capi.awesome.font_height * 1.5 }) elseif position == "right" then w.orientation = "south" - w:geometry({ width = capi.awesome.font_height * 1.5 }) end w.screen = arg.screen or 1