wibox.drawable: Do not relayout while invisible
Similar to the previous commit, this makes the drawable not apply a pending relayout while it is not visible. When it becomes visible again, the relayout is done. The hope here is that less work is done while a drawable is not visible, saving CPU time. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
9b51779f2f
commit
0183372ac2
|
@ -429,7 +429,11 @@ function drawable.new(d, widget_context_skeleton, drawable_name)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ret._need_relayout = true
|
ret._need_relayout = true
|
||||||
ret:draw()
|
-- When not visible, we will be redrawn when we become visible. In the
|
||||||
|
-- mean-time, the layout does not matter much.
|
||||||
|
if ret._visible then
|
||||||
|
ret:draw()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add __tostring method to metatable.
|
-- Add __tostring method to metatable.
|
||||||
|
|
Loading…
Reference in New Issue