diff --git a/lib/awful/root.lua b/lib/awful/root.lua index 373665eb7..6f28f5da5 100644 --- a/lib/awful/root.lua +++ b/lib/awful/root.lua @@ -106,6 +106,14 @@ for _, type_name in ipairs { "button", "key" } do table.insert(removed, value) end + capi.root["has_"..type_name] = function(item) + if not item["_is_capi_"..type_name] then + item = item[1] + end + + return gtable.hasitem(capi.root["_"..prop_name](), item) ~= nil + end + assert(root[prop_name]) end