From 8dfe18a3825c4a6a554de3e2d4d70e76ccd4b600 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 4 Aug 2017 13:10:14 +0200 Subject: [PATCH] Fix wibox to forward shapes directly When doing w.shape_bounding = foo on a wibox, the code would first read shape_bounding from the underlying drawin. This would create a (possibly) huge cairo image surface that just waits to be collected by the garbage collector, resulting in increased memory usage. Fix this by checking the force_forward table first. This tables contains the names of shape properties. Thus, the evaluation of this statement gets short-circuited and the property is on the drawin is not read. Helps-with: https://github.com/awesomeWM/awesome/issues/1958 Signed-off-by: Uli Schlachter --- lib/wibox/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wibox/init.lua b/lib/wibox/init.lua index b2c8d6faa..f90284ac6 100644 --- a/lib/wibox/init.lua +++ b/lib/wibox/init.lua @@ -272,7 +272,7 @@ local function new(args) __newindex = function(self, k,v) if rawget(self, "set_"..k) then self["set_"..k](self, v) - elseif w[k] ~= nil or force_forward[k] then + elseif force_forward[k] or w[k] ~= nil then w[k] = v else rawset(self, k, v)