From d8f20e34fe00ac1ea86beac9c06fb448e6f3dc39 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 26 Jan 2009 10:37:52 +0100 Subject: [PATCH] awful.tag: setters have low and high bounding values Signed-off-by: Julien Danjou --- lib/awful/tag.lua.in | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/awful/tag.lua.in b/lib/awful/tag.lua.in index 952dadf7..aefcbf1c 100644 --- a/lib/awful/tag.lua.in +++ b/lib/awful/tag.lua.in @@ -103,8 +103,10 @@ end -- @param mwfact Master width factor. function setmwfact(mwfact, t) local t = t or selected() - setproperty(t, "mwfact", mwfact) - capi.hooks.arrange()(t.screen) + if mwfact >= 0 and mwfact <= 1 then + setproperty(t, "mwfact", mwfact) + capi.hooks.arrange()(t.screen) + end end --- Increase master width factor. @@ -125,8 +127,10 @@ end -- @param t Optional tag. function setnmaster(nmaster, t) local t = t or selected() - setproperty(t, "nmaster", nmaster) - capi.hooks.arrange()(t.screen) + if nmaster >= 0 then + setproperty(t, "nmaster", nmaster) + capi.hooks.arrange()(t.screen) + end end --- Get the number of master windows. @@ -163,8 +167,10 @@ end -- @param ncol The number of column. function setncol(ncol, t) local t = t or selected() - setproperty(t, "ncol", ncol) - capi.hooks.arrange()(t.screen) + if ncol >= 1 then + setproperty(t, "ncol", ncol) + capi.hooks.arrange()(t.screen) + end end --- Get number of column windows.