From e0897cf17070700c47efbffde7bce4ab72a4930e Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 13 Mar 2016 03:43:50 -0400 Subject: [PATCH] tag: Support property fallback --- lib/awful/tag.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/awful/tag.lua b/lib/awful/tag.lua index e51c3a828..1a8b0a7ae 100644 --- a/lib/awful/tag.lua +++ b/lib/awful/tag.lua @@ -11,6 +11,7 @@ local util = require("awful.util") local ascreen = require("awful.screen") local beautiful = require("beautiful") +local object = require("gears.object") local pairs = pairs local ipairs = ipairs local table = table @@ -873,6 +874,16 @@ function tag.mt:__call(...) return tag.new(...) end +-- Extend the luaobject +-- `awful.tag.setproperty` currently handle calling the setter method itself +-- while `awful.tag.getproperty`. +object.properties(capi.tag, { + getter_class = tag, + setter_class = tag, + getter_fallback = tag.getproperty, + setter = tag.setproperty, +}) + return setmetatable(tag, tag.mt) -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80