From 7fc0c24f4f914b91e07cb05593d1f5a4b03c02e4 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 9 Sep 2009 10:39:08 +0200 Subject: [PATCH] awful.wibox: Error out on invalid positions Signed-off-by: Uli Schlachter Signed-off-by: Julien Danjou --- lib/awful/wibox.lua.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/awful/wibox.lua.in b/lib/awful/wibox.lua.in index c5ef8027..1bae18b5 100644 --- a/lib/awful/wibox.lua.in +++ b/lib/awful/wibox.lua.in @@ -17,6 +17,7 @@ local ipairs = ipairs local table = table local type = type local image = image +local error = error --- Wibox module for awful. -- This module allows you to easily create wibox and attach them to the edge of @@ -213,6 +214,12 @@ function new(arg) -- Empty position and align in arg so we are passing deprecation warning arg.position = nil + if position ~= "top" and position ~="bottom" + and position ~= "left" and position ~= "right" then + error("Invalid position in awful.wibox(), you may only use" + .. " 'top', 'bottom', 'left' and 'right'") + end + -- Set default size if position == "left" or position == "right" then arg.width = arg.width or capi.awesome.font_height * 1.5 -- 2.11.4.GIT