Hi,
thanks to psychon and farhaven for pointing it out and helping me with
this. There was one global variable in place of a local one and the
hackish way of requiring the grid layout is now a bit less hackish.
cheers
lukash
>From 1758d829d354ab34dc96fb6eb2e6295edabc7a55 Mon Sep 17 00:00:00 2001
From: Lukas Hrazky <[email protected]>
Date: Tue, 27 Oct 2009 22:37:02 +0100
Subject: [PATCH] few formal fixes for widget layouts
Signed-off-by: Lukas Hrazky <[email protected]>
---
lib/awful/widget/layout/grid.lua.in | 7 ++-----
lib/awful/widget/layout/init.lua.in | 2 +-
lib/awful/widget/layout/linear_common.lua.in | 2 +-
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/lib/awful/widget/layout/grid.lua.in b/lib/awful/widget/layout/grid.lua.in
index ede3376..632ee6a 100644
--- a/lib/awful/widget/layout/grid.lua.in
+++ b/lib/awful/widget/layout/grid.lua.in
@@ -18,8 +18,6 @@ local clone = util.table.clone
local margins = awful.widget.layout.margins
local layout = awful.widget.layout
---module("awful.widget.layout.grid")
-
local M = {}
@@ -79,7 +77,7 @@ end
-- Places the widgets in a grid.
-- @see awful.widget.layout for a luadoc
-local function grid(bounds, widgets, screen)
+function M.grid(bounds, widgets, screen)
local widths = {}
local heights = {}
@@ -197,7 +195,6 @@ local function grid(bounds, widgets, screen)
return geometries
end
---setmetatable(_M, { __call = function(_, ...) return grid(...) end })
-return grid
+return M
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
diff --git a/lib/awful/widget/layout/init.lua.in b/lib/awful/widget/layout/init.lua.in
index c870a69..7bd7b8c 100644
--- a/lib/awful/widget/layout/init.lua.in
+++ b/lib/awful/widget/layout/init.lua.in
@@ -85,6 +85,6 @@ require("awful.widget.layout.vertical")
-- @return A table of geometries of all the widgets.
-- @name grid
-- @class function
-grid = require("awful.widget.layout.grid")
+grid = require("awful.widget.layout.grid").grid
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
diff --git a/lib/awful/widget/layout/linear_common.lua.in b/lib/awful/widget/layout/linear_common.lua.in
index 5f32b2a..b431c05 100644
--- a/lib/awful/widget/layout/linear_common.lua.in
+++ b/lib/awful/widget/layout/linear_common.lua.in
@@ -245,7 +245,7 @@ function linear_common.flex(idx, bounds, widgets, screen)
insert(geometries, v)
end
elseif type(v) == "widget" then
- g = v:extents(screen)
+ local g = v:extents(screen)
-- resize to fit the width available if requested
if v.resize and g.width > 0 and g.height > 0 then
--
1.6.5