awesome/lib/wibox/container
Uli Schlachter 67cf1469f0 Change the way the shape is done in the background container
Previously, the background container "just" used the shape and drew a
line around it. This means that half the line will be inside of the
shape and half of it will be outside. Thus, this hides the actual shape
that is used.

This commit changes that so that the line is added outside of the shape.
It does this via some tricks:

- In :before_draw_children(), :push_group() is used to redirect drawing
  of the child widget to a temporary surface.
- In :after_draw_children(), the border is added to this group.
  + For this, another temporary surface is created. It will be used as a
    mask.
  + The inside of the shape on this mask is cleared, everything else is
    filled. Thus, the mask now contains everything "not content".
  + Everything inside the mask is filled with the background color.
- Also in :after_draw_children(), the group is drawn to the actual
  target surface.
  + Again, this needs a mask.
  + This time, we draw the shape to the mask with twice the border width.
    Thus, half of this line will be outside of the shape.
  + Then, the shape itself is also filled so that the mask contains the
    shape and the border.
  + This mask is then used to copy the right parts of the temporary
    surface were the child widget and border was drawn to the actual
    target surface that will be visible on screen.

This approach has some upsides. Because we no longer have "half the
border" above content, colors with some transparency work fine for the
border. Also, this should avoid issues with anti-aliasing, because e.g.
the border is not just drawn with the border width, but also further out
to everything else so that the background cannot "bleed through".

Fixes: https://github.com/awesomeWM/awesome/issues/2516
Signed-off-by: Uli Schlachter <psychon@znc.in>
2019-01-27 11:42:36 +01:00
..
arcchart.lua doc: Fix arcchart documentation (#1643) 2017-03-08 16:05:23 -05:00
background.lua Change the way the shape is done in the background container 2019-01-27 11:42:36 +01:00
constraint.lua gears: Move awful.util.table to gears.table (#1641) 2017-03-08 15:18:33 -05:00
init.lua container: Add an placement container. 2017-02-11 16:10:13 -05:00
margin.lua gears: Move awful.util.table to gears.table (#1641) 2017-03-08 15:18:33 -05:00
mirror.lua mirror: Fix documentation 2017-06-26 02:27:20 -04:00
place.lua gears: Move awful.util.table to gears.table (#1641) 2017-03-08 15:18:33 -05:00
radialprogressbar.lua gears: Move awful.util.table to gears.table (#1641) 2017-03-08 15:18:33 -05:00
rotate.lua gears: Move awful.util.table to gears.table (#1641) 2017-03-08 15:18:33 -05:00
scroll.lua gears: Move awful.util.table to gears.table (#1641) 2017-03-08 15:18:33 -05:00