Commit Graph

48 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee f1dceb02f6 doc: Move all popups to a section. 2019-06-08 18:13:42 -04:00
Emmanuel Lepage Vallee 9d0c2200b2 doc: Add a section for the important classes.
The choice is very subjective, but at least they stand out.
2019-06-08 18:13:28 -04:00
Adrian Gabriel 0642d92967 Fixed input_passthrough property not being set (#2723)
* Fixed input_passthrough property not being set

In the table of properties supplied to the `wibox` function, you couldn't set the `input_passthrough` property. You could only set it after the wibox was created like this: `my_shlick_wibox.input_passthrough = true`. This commit fixes that and now you can set it in both ways.
2019-03-12 17:23:53 +01:00
Emmanuel Lepage Vallée a2cd918603
wibox: Stop monkey-patching the `get_children_by_id` function. (#2513)
Before this commit, it was added by `wibox.widget.base` if
`:setup()` is used. However it doesn't work for the `awful.popup`
because of the extra indirection.

This commit stops the monkey-patching and make sure the function
always exists. This doesn't prevent it from not working and in
the long run this should still be moved into the hierarchy.

However for now it makes the situation a lot more consistent and is a
quick band-aid without too much controversy.

Mitigate #2181
2019-01-01 15:04:47 -05:00
Emmanuel Lepage Vallee 7d6f52c4dc wibox: Add the wibox reference to `find_widgets`
This is necessary to compute the widget real position on screen
because it's the only way to know the border_width offset.
2018-12-24 21:52:30 -05:00
Emmanuel Lepage Vallee d99504775b doc: Mutualize the wibar and wibox constructor documentation.
Do it now since the future awful.popup and notification widget
also uses it.

The `load_ldoc.cmake` changes allow to include `.ldoc` blocks in
existing ldoc comments. Previously, it added some extra newlines
and an autogenerated comments saying the content below was imported.
The problem is that this prevented the system to be used for shared
function arguments.

This commit also renames the `wibar` argument table from `arg` to
`args` as the name has to be the same in the `wibox` and `wibar`
constructor for this to work.
2017-11-27 00:22:11 -05:00
Emmanuel Lepage Vallee 4e54aea6a9 wibox: Add an input_passthrough property.
Allows, for example, to have semi translucent wibars on top of
the fullscreens clients without having issues with inputs.
2017-11-27 00:20:42 -05:00
Emmanuel Lepage Vallee cedeb2bb5a wibox: Add a `to_widget()` and `save_to_svg()` method.
Take a wibox snapshot as a widget. It also add an helper to save
it to a file. This is useful for debugging when called from
`awesome-client`
2017-10-21 19:34:04 +02:00
Uli Schlachter 8dfe18a382 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>
2017-08-04 13:10:14 +02:00
Emmanuel Lepage Vallée cbd22eea50 Merge pull request #1475 from psychon/input-shape-support
Input shape support
2017-02-03 12:25:56 -05:00
Uli Schlachter 47d69e7824 Update docs for shape_input
I grepped for shape_clip and edited places that needed editing.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2017-01-26 11:15:28 +01:00
Uli Schlachter ddfe652173 fixup! wibox: Add shape property 2016-12-26 13:55:33 +01:00
Uli Schlachter 1a9887335e wibox: Add shape property
This bridges between gears.shape and the shapes. So far, it does not try
to do any kind of anti-aliasing magic, so you get "steep edges".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-12-26 13:28:34 +01:00
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