Commit Graph

365 Commits

Author SHA1 Message Date
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
Emmanuel Lepage Vallee b6421699da doc: Add more graph documentation. 2016-09-26 01:20:57 -04:00
Emmanuel Lepage Vallee 5ef9b64b40 graph: Add shape support
This complete the shape API. Now, everything support shapes.
2016-09-26 01:20:57 -04:00
Emmanuel Lepage Vallee 68999f4a86 graph: Add min_value
Fix #277
2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee f517538b6a background: Avoid some redraw 2016-09-26 01:20:56 -04:00
Emmanuel Lepage Vallee 549d68dcc5 doc: Add more progressbar shape examples 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 7b11f1c1b4 tests: Test progressbat paddings, margins and clip 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee a8568eb969 doc: Add examples for vertical and labelled progressbar 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee e1733dd37a progressbar: Add paddings and margins properties
This restore a feature that was available in Awesome 2.1-3.2.

The reason margin is implemented rather than use a container is to
be able to make the background smaller than the bar.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 915c10b1f8 progressbar: Add shape support
The current progressbar code dates from a time when Awesome had
a very limited drawing API. This commit first re-write the
algorithm to remove the workaround used to draw the border using
full rectangles only. It then add support for outer and inner
shapes with their respective border settings.

This commit also add clip support. This is enabled by default, but
could be disabled to have the bar taller than the background.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 8ec53c827b progressbar: Fix a race condition
When created using the declarative syntax, set_value could be
called before set_max_value, this trimmed the value.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee e5d4c188f1 progressbar: Remove vertical/width/height code
The deprecation message should be enough. This doesn't remove
the functionalities themselves.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee e28b79944f doc: Use @property for the progressbar doc. 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 8d7f228301 progressbar: Conform to the new widget conventions.
It is not Awesome 3.2 anymore, progressbars are no longer userdata.
2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 7cbcc800bc progressbar: Remove dead code. 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 2c620468f0 progressbar: Deprecate width, height and vertical properties. 2016-09-26 01:18:09 -04:00
Emmanuel Lepage Vallee 89f796b268 doc: Fix copy paste mistake. 2016-09-25 22:47:35 -04:00
Daniel Hahler 9b7e655afe Merge pull request #1111 from psychon/assorted-fixes
Some assorted fixes
2016-09-25 01:35:55 +02:00
Emmanuel Lepage Vallee 525a76018f container: Add an 'Arc chart' container.
A lot of conky config use this type of widgets. It looks very nice
on thicker wiboxes.
2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee 0a3a71dd45 widgets: Add a piechart widget. 2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee 3f0b033e72 checkbox: Add a shape based checkbox widget. 2016-09-24 14:45:09 -04:00
Emmanuel Lepage Vallee a4743ed2c2 radialprogressbar: Upstream Elv13 round progressbar 2016-09-24 14:45:08 -04:00
Uli Schlachter ab135fa7c9 wibox.drawable: Don't redraw invalid drawables
Twice now we had problems with the garbage collector which caused signals
established via weak_connect_signal() not to be disconnected when we wanted them
to be disconnected. The effect was that we tried to redraw a drawable after it
was garbage collected which caused errors.

Instead of playing whack-a-mole with all the various ways that might make us
redraw a drawable after GC, let's just fix all of these issues by explicitly
checking for this case and turning it into a no-op.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Uli Schlachter f6761e662c wibox.drawable: React to screen changes
The previous commit made wibox.drawable turn a "normal redraw" into a complete
repaint when it was moved to another screen. However, nothing happened until
that normal redraw.

This commit triggers a normal redraw when we are (possibly) moved to another
screen. More precise, this means that whenever a screen appears, disappears or
changes its geometry and when the drawable is moved, we trigger a normal redraw.
This redraw will likely do nothing, because no relayout is pending and no part
of the surface needs a redraw, so it is cheap.

However, if the drawable really ends up on another screen, then the code from
the previous commits makes us do a full relayout and redraw.

This commit likely fixes the current instability of test-screen-changes.lua. See
https://github.com/awesomeWM/awesome/issues/982#issuecomment-231712056.

As explained there, the test fails because the fake screen that it created is
still referenced, so cannot be garbage collected, but the test doesn't succeed
unless the screen is garbage collected. So something is still referencing the
screen that was removed. This something can be a client's titlebar, because the
underlying drawable still has a context member referring to the old screen.

This commit should fix that problem, because we now trigger a redraw which will
compute a new context and thus the reference to the old screen is released.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Uli Schlachter 752d49ed47 wibox.drawable: Force full repaint when the context changes
The previous commit made the hierarchy do a re-layout when the context changes.
However, widgets could change their appearance depending on the context without
changing their layout. Thus, the previous commit is not enough.

This commit also makes the drawable redraw everything when the context changes.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +02:00
Uli Schlachter e0a3ecba01 wibox.hierarchy: Update when the context changes
When the context for widget changes (e.g. we are on a new different screen or
have a different DPI value), widgets might change their appearance even though
they didn't emit widget::layout_changed. Thus, update the hierarchy in these
cases.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-09-24 14:37:07 +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
Emmanuel Lepage Vallee 12b72d6164 drawable: Prevent collected drawables from being redrawn. 2016-09-07 00:41:10 -04:00
Emmanuel Lepage Vallee 370d333590 widget: Add recursive signals.
This allows to ignore containers and layouts when a signal is sent.
2016-08-20 15:41:12 -04:00
Emmanuel Lepage Vallee ec923e96fc layout: Add more signals. 2016-08-17 02:31:16 -04:00
Emmanuel Lepage Vallee 41feec02a5 widget.base: Fix the root get_children_by_id() widget.
If the wibox root widget had an id, it was added to the properties,
but not the get_children_by_id() table
2016-08-01 15:26:29 -04:00
Emmanuel Lepage Vallée 78171ea038 Merge pull request #1010 from Elv13/fix_declarative_widgets
widgets: Apply attributes before adding the widgets
2016-07-24 14:58:07 -04:00
Emmanuel Lepage Vallee 79394c0965 widgets: Apply attributes before adding the widgets
For example, some layouts may place the widgets in a different order
depending on some attreibutes.
2016-07-23 17:24:13 -04:00
Emmanuel Lepage Vallee c159ad3ab2 drawable: Add more data to the find_widgets metadata table 2016-07-23 16:46:11 -04:00
Uli Schlachter 7f74c7c859 drawable: Draw bgimage with operator OVER
The actual bg is drawn either with fake transparency over the wallpaper (this
uses operator OVER) or for true transparency with operator SOURCE. The bgimage
should be drawn ontop of this without erasing the background and thus needs
operator OVER.

However, before this commit the bgimage was drawn in the same way as the bg and
thus inherited its SOURCE operator if a compositor is running. Fix this by
restoring the default operator (OVER) and also e.g. the default source before
drawing the bgimage.

Fixes: https://github.com/awesomeWM/awesome/issues/954
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-09 10:30:36 +02:00
Uli Schlachter d4454aba15 Fix drawable:set_bgimage()
When called with the file name of an image, this function failed to turn that
file name into a cairo surface.

Fixes: https://github.com/awesomeWM/awesome/issues/954
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-09 10:29:05 +02:00
Emmanuel Lepage Vallee 6eca36d764 progressbar: Add missing includes documentation variables 2016-06-24 15:59:02 -04:00
Salorium b0d42e258a Correct name variable: this typo introduced into in 03e2310c54 2016-06-18 17:42:27 +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 756862dff6 systray: Use table.crush 2016-05-30 23:12:49 -04:00
Emmanuel Lepage Vallee cbe046b0db progressbar: Add theme options 2016-05-30 23:10:03 -04:00
Emmanuel Lepage Vallee 7c00b2a55a graph: Add theme options 2016-05-30 23:10:02 -04:00
Emmanuel Lepage Vallee f9ff2f4909 stack: Enable the property system
And add the missing documentation
2016-05-30 23:10:02 -04:00
Emmanuel Lepage Vallee 23729b6296 flex: Enable the property system
And add the missing documentation
2016-05-30 23:10:02 -04:00
Emmanuel Lepage Vallee eddbbf7aca ratio: Enable the property system
And add the missing documentation
2016-05-30 23:10:02 -04:00
Emmanuel Lepage Vallee 0a8bc8156d align: Enable the property system
And add the missing documentation
2016-05-30 23:10:02 -04:00
Emmanuel Lepage Vallee b89fbcf940 fixed: Enable the property system
And add the missing documentation
2016-05-30 23:10:02 -04:00
Emmanuel Lepage Vallee 18500838d9 textclock: Add missing documentation 2016-05-30 23:10:02 -04:00