awesome/lib/awful
Sergey Vlasov 29f1719026 awful.titlebar: Fix GC for titlebar widgets (#2830)
Some titlebar widgets (`awful.titlebar.widget.titlewidget`,
`awful.titlebar.widget.button` and other specific button widgets) could
not be garbage collected until the associated client was unmanaged,
because the signal connection used to update the widget was never
destroyed, and the signal handling function was keeping a reference to
the widget in its environment.  This resulted in high memory usage when
the titlebar widgets were recreated multiple times for the same client
(this does not happen with the default Awesome configuration, but may be
needed for dynamic titlebar reconfiguration in a custom config).

Modify the code to use weak tables instead of direct signal connections
to avoid keeping strong references to widgets.  The widget update
functions still keep strong references to the widget itself (creating a
reference loop, but the Lua GC should handle it correctly) and the
client object, but this should not be a problem.

One publicly visible change is that `awful.titlebar.widget.titlewidget`
now has an `update` function, like the button widgets.

Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
2019-07-22 11:12:16 +03:00
..
client Use memory shorter with awful.client.shape (#2051) 2017-10-07 18:22:50 +02:00
hotkeys_popup doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
layout doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
mouse mouse: Do not display the snap helpers when a client isn;t floating. (#2818) 2019-07-10 17:16:41 -04:00
widget doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
autofocus.lua doc: Fix an awful.autofocus warning 2019-04-05 20:40:53 -04:00
button.lua gears: Move awful.util.table to gears.table (#1641) 2017-03-08 15:18:33 -05:00
client.lua doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
completion.lua doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
dbus.lua Remove traces of the old URL (#1280) 2016-12-21 02:03:03 +01:00
ewmh.lua doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
init.lua Do not recommend io.popen() 2019-02-27 10:26:16 +01:00
key.lua doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
keygrabber.lua doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
menu.lua doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
placement.lua awful.placement: Fix no_overlap with unselected tags (#2809) 2019-07-04 16:42:15 +03:00
popup.lua doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
prompt.lua doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
remote.lua awful.remote: Protect against error(nil) (#2748) 2019-04-14 12:34:52 -04:00
rules.lua doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
screen.lua doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
spawn.lua doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
startup_notification.lua Add beautiful property to control busy cursor during spawn 2017-03-01 21:57:59 +01:00
tag.lua doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
titlebar.lua awful.titlebar: Fix GC for titlebar widgets (#2830) 2019-07-22 11:12:16 +03:00
tooltip.lua doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
util.lua doc: Fix all the property, theme and field types. 2019-06-08 18:14:14 -04:00
wibar.lua doc: Use an explicit tag for all static functions. 2019-06-08 18:14:13 -04:00
wibox.lua doc: Add missing C-object documentation and fix some papercuts. 2018-07-25 18:26:11 -04:00