Commit Graph

35 Commits

Author SHA1 Message Date
Uli Schlachter 4d2a1d5534 wibox.drawable: Support forced screens
Up to now, a drawable always figured out the screen that it is on by
looking at its position. This causes memleak-like problems with wibars:
A wibar has a screen assigned, but its underlying drawable will end up
referring to another screen. Via this, we were managing to build a long
reference chain of screens and drawable that meant that none of the fake
screens that our test suite added could be garbage collected.

To fix this, add wibox.drawable._force_screen(s). After this function is
called, the normal screen detection based on the position is skipped and
instead the given screen is always used. This breaks the above reference
chain and things become garbage-collectable.

Also, this chains the drawable to the life time of the screen: When the
screen becomes invalid (.valid == false), the drawable will stop
redrawing.

Fixes: https://github.com/awesomeWM/awesome/issues/1237
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-18 10:56:47 +01:00
Uli Schlachter 259c4f716f Remove @release @AWESOME_VERSION@ everywhere (#1157)
It does not provide much value. The version number is already known to
ldoc globally in the "description" variable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-09 22:36:20 +02:00
Daniel Hahler 05d962f778 Merge pull request #1147 from psychon/remove_weak_tables
Remove some weak tables
2016-10-07 22:00:23 +02:00
Uli Schlachter 90044e00da wibox: Remove weak table hack
No idea what self referencing loops this refers to. Lua 5.1's and
LuaJIT's garbage collector both should handle cycles just fine. Things
only start getting complicated when you start using weak tables.

Unless someone comes up with an example where this patch causes a leak,
let's remove the weak table magic.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-05 20:35:04 +02:00
Uli Schlachter 843d0bdcf5 wibox.drawable: Add visibility tracking callback
This new function is called whenever the visibility of the drawable
changes. Later commits can use this for explicitly tracking the lifetime
of drawables instead of using magic weak tables.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-10-04 21:18:18 +02:00
Uli Schlachter 8d2dde3a34 wibox: Remove some dead code
widget_at() no longer exists since 0aa4304bda (and the surrounding commits
stopped us using this function).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Daniel Hahler d9cd0a4f0e Merge pull request #948 from psychon/deprecate-add-signal
Deprecate add_signal
2016-06-07 22:58:14 +02:00
Uli Schlachter 0857f6f1b5 Lua: Remove calls to add_signal()
The requirement to call add_signal() was added to catch typos. However, this
requirement became increasingly annoying with property::<name> signals and e.g.
gears.object allowing arbitrary properties to be changed.

All of this ended up in a single commit because tests/examples fails if I first
let add_signal() emit a deprecation warning.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-04 18:23:48 +02:00
Uli Schlachter a7f7cab564 wibox: Remember the screen that was assigned
If screens overlap, the wibox should still remember which of the possible
screens it is assigned to.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-04 17:39:51 +02:00
Emmanuel Lepage Vallee d85588babe wibox: Create a container module
Previously, the "containers" were placed in layout or widget.

They all have similar APIs and usage, so lets bring them together.
2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee 4d45063adb wibox: Add constructor documentation
The leading point is on purpose. It work around a ldoc bug and is
already used elsewhere (like signals without a ::)
2016-05-19 01:27:05 -04:00
Emmanuel Lepage Vallee f26fa5e099 wibox: Add more constructor arguments
Fixes #916
2016-05-19 01:27:05 -04:00
Emmanuel Lepage Vallee 251614afff wibox: Remove the dependency on `awful` 2016-05-16 01:18:28 -04:00
Emmanuel Lepage Vallee 77380eb121 wibox: Move the documentation to a shared file
To be re-used by wibars, tooltips and menus
2016-05-15 17:17:12 -04:00
Emmanuel Lepage Vallee a141dbfd06 wibox: Add screen properties 2016-05-15 17:17:11 -04:00
Emmanuel Lepage Vallee 129b3b1d50 wibox: Add wibox property support
Just like the miss handler system, but for wiboxes.

This will simplify the API as there was a mix of properties
and accessors in the API doc.
2016-05-15 17:17:09 -04:00
Emmanuel Lepage Vallee 9a72062cac wibox: Turn into "real" objects.
Before this commit, it was necessary to call 'rawset' to be
able to add new fields to the wibox. This is no longer required.

This solution was choosen because wibox is itself a base class of
menus and wibars. Those classes can now add new properties without
hacks.
2016-05-15 17:15:55 -04:00
Emmanuel Lepage Vallee df6bc2f6bc wibox: Make the table argument optional
For consistency with other objects.
2016-05-15 17:15:55 -04:00
Emmanuel Lepage Vallee 81064daa42 doc: Fix find_widgets() doc. 2016-05-04 17:25:05 -04:00
Emmanuel Lepage Vallee baf290a8b2 drawin: Add a get_wibox function
As wibox contain a drawin, but isn't one, it is necessary to map
drawin to wibox.

This could eventually be fixed by turning wibox into drawin just
like the client, tag and screen do.
2016-05-04 17:25:05 -04:00
Emmanuel Lepage Vallee 5404b3c374 drawin: Add a property miss handler 2016-05-04 16:37:39 -04:00
Emmanuel Lepage Vallee 1a114e4e57 wibox: Import drawin documentation
This improve consistency.
2016-05-03 17:12:54 -04:00
Emmanuel Lepage Vallee dc687c0e31 wibox: Clone missing signals 2016-03-12 21:18:09 -05:00
Uli Schlachter 15e72fb037 Fix luacheck warnings in lib/wibox
Warnings pointing out actual problems are left.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-12 09:15:55 +01:00
Daniel Hahler 58954f7f08 Merge pull request #675 from psychon/remove-gears.sort
Remove gears.sort
2016-02-11 21:51:44 +01:00
Emmanuel Lepage Vallée ff8f2aef27 Merge pull request #678 from Elv13/bgimage
Extend bgimage support
2016-02-10 03:59:06 -05:00
Emmanuel Lepage Vallee 7842f92f08 wibox: Support the declarative container syntax
Also support it for titlebars
2016-02-10 01:25:31 -05:00
Emmanuel Lepage Vallee c957b3d5a8 wibox: Support bg_image 2016-02-10 00:15:14 -05:00
Uli Schlachter 94e9a030c1 Remove gears.sort
It's unused since commit 0aa4304bda. Before this was a stable sorting
algorithm since table.sort is allowed to be unstable. Apparently we don't need a
stable sorting algorithm anymore.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-07 12:24:35 +01:00
Daniel Hahler 4bffa7e47e doc: fix unintentional rendering as code due to indent 2015-10-14 00:22:26 +02:00
Uli Schlachter 02f67b61b4 Add a widget hierarchy implementation
A widget hierarchy describes the position of widgets. The hierarchy is a
recursive tree of widget hierarchy instances. This functionality depends on a
:layout function that is not yet implemented on widgets, but will be added
later.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-09-05 14:28:52 +02:00
Uli Schlachter 31b69dbe1a drawable: Use a context table as first argument to :draw()
This table contains the drawable, wibox and titlebar that we are drawing on, but
also includes the screen and the DPI of that screen. This allows widgets to
depend on the DPI in their rendering.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:17:48 +02:00
Daniel Hahler d3b682f2b6 wibox: add __tostring metamethod 2015-08-01 11:21:50 +02:00
Daniel Hahler 430e8664be wibox.drawable: add __tostring meta method 2015-08-01 11:21:50 +02:00
Julian Wollrath 6cc7be512c Remove the *.in from all files.
Signed-off-b: Julian Wollrath <jwollrath@web.de>
2015-06-19 22:33:32 +02:00