awful.tag: do not use otable() anymore
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
e4ab810154
commit
22b0fe8140
|
@ -8,7 +8,7 @@
|
||||||
local util = require("awful.util")
|
local util = require("awful.util")
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local otable = require("otable")
|
local setmetatable = setmetatable
|
||||||
local capi =
|
local capi =
|
||||||
{
|
{
|
||||||
hooks = hooks,
|
hooks = hooks,
|
||||||
|
@ -25,7 +25,7 @@ local data = {}
|
||||||
data.history = {}
|
data.history = {}
|
||||||
data.history.past = {}
|
data.history.past = {}
|
||||||
data.history.current = {}
|
data.history.current = {}
|
||||||
data.tags = otable()
|
data.tags = setmetatable({}, { __mode = 'k' })
|
||||||
|
|
||||||
-- History functions
|
-- History functions
|
||||||
history = {}
|
history = {}
|
||||||
|
@ -236,14 +236,6 @@ function viewmore(tags, screen)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function hook_tags(screen, tag, action)
|
|
||||||
if action == "remove" then
|
|
||||||
data.tags[tag] = nil
|
|
||||||
elseif action == "add" then
|
|
||||||
data.tags[tag] = {}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Get tag data table.
|
--- Get tag data table.
|
||||||
-- @param tag The Tag.
|
-- @param tag The Tag.
|
||||||
-- @return The data table.
|
-- @return The data table.
|
||||||
|
@ -267,13 +259,11 @@ end
|
||||||
-- @param tag The tag.
|
-- @param tag The tag.
|
||||||
-- @param prop The property name.
|
-- @param prop The property name.
|
||||||
-- @param value The value.
|
-- @param value The value.
|
||||||
-- @return True if the value has been set, false otherwise.
|
|
||||||
function setproperty(tag, prop, value)
|
function setproperty(tag, prop, value)
|
||||||
if data.tags[tag] then
|
if not data.tags[tag] then
|
||||||
data.tags[tag][prop] = value
|
data.tags[tag] = {}
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
return false
|
data.tags[tag][prop] = value
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Tag a client with the set of current tags.
|
--- Tag a client with the set of current tags.
|
||||||
|
@ -293,7 +283,6 @@ end
|
||||||
|
|
||||||
-- Register standards hooks
|
-- Register standards hooks
|
||||||
hooks.arrange.register(history.update)
|
hooks.arrange.register(history.update)
|
||||||
hooks.tags.register(hook_tags)
|
|
||||||
hooks.manage.register(withcurrent)
|
hooks.manage.register(withcurrent)
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue