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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2017-08-04 13:10:14 +02:00
parent 2886095358
commit 8dfe18a382
1 changed files with 1 additions and 1 deletions

View File

@ -272,7 +272,7 @@ local function new(args)
__newindex = function(self, k,v) __newindex = function(self, k,v)
if rawget(self, "set_"..k) then if rawget(self, "set_"..k) then
self["set_"..k](self, v) 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 w[k] = v
else else
rawset(self, k, v) rawset(self, k, v)