awful.widget.taglist: remove otable usage
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
4db50647fe
commit
2dfbd6ea2c
|
@ -9,8 +9,8 @@ local capi = { widget = widget,
|
||||||
screen = screen,
|
screen = screen,
|
||||||
image = image,
|
image = image,
|
||||||
client = client }
|
client = client }
|
||||||
local otable = require("otable")
|
|
||||||
local type = type
|
local type = type
|
||||||
|
local setmetatable = setmetatable
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local hooks = require("awful.hooks")
|
local hooks = require("awful.hooks")
|
||||||
|
@ -48,7 +48,7 @@ function new(screen, label, buttons)
|
||||||
["right"] = 0},
|
["right"] = 0},
|
||||||
["bg_resize"] = true
|
["bg_resize"] = true
|
||||||
}
|
}
|
||||||
local data = otable()
|
local data = setmetatable({}, { __mode = 'k' })
|
||||||
local u = function (s)
|
local u = function (s)
|
||||||
if s == screen then
|
if s == screen then
|
||||||
taglist_update(s, w, label, buttons, data, widgets)
|
taglist_update(s, w, label, buttons, data, widgets)
|
||||||
|
@ -65,10 +65,6 @@ function new(screen, label, buttons)
|
||||||
u(c.screen)
|
u(c.screen)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
-- Free data on tag removal
|
|
||||||
hooks.tags.register(function (s, tag, action)
|
|
||||||
if action == "remove" then data[tag] = nil end
|
|
||||||
end)
|
|
||||||
u(screen)
|
u(screen)
|
||||||
return w
|
return w
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue