wibox: Add widget geometry cache
commit3edd21656070601ccbfdb9498716bb5c1ef54de8
authorUli Schlachter <psychon@znc.in>
Wed, 21 Aug 2013 10:26:47 +0000 (21 12:26 +0200)
committerUli Schlachter <psychon@znc.in>
Wed, 21 Aug 2013 10:26:47 +0000 (21 12:26 +0200)
treed34a6ac249b2a2791f51f6c7674455027f9dd95c
parenta0e45e878e450d890a0ab541d48d8dd6c1ede943
wibox: Add widget geometry cache

This commit adds and uses wibox.layout.base.fit_widget(). This function is a
wrapper for widget:fit() that caches the result and thus speeds things up.

This is necessary because some layouts call :fit() from their :fit() and :draw()
functions. Nesting such layouts means that at the widget at the tail of the
stack gets its :fit() function called quite often. If this function is not
blazingly fast, this results in noticeable slowness.

Signed-off-by: Uli Schlachter <psychon@znc.in>
lib/wibox/layout/align.lua.in
lib/wibox/layout/base.lua.in
lib/wibox/layout/constraint.lua.in
lib/wibox/layout/fixed.lua.in
lib/wibox/layout/flex.lua.in
lib/wibox/layout/margin.lua.in
lib/wibox/layout/mirror.lua.in
lib/wibox/layout/rotate.lua.in
lib/wibox/widget/base.lua.in