awesome/lib
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
..
awful Merge pull request #2521 from Elv13/modifiers 2019-01-24 23:59:54 -05:00
beautiful beautiful.init: Fix return values and improve doco. fixes: #2588 #2592 2019-01-25 22:56:41 +11:00
gears gears: Add `find_keys` and `find_first_key` to `gears.table`. 2019-01-24 06:31:57 -05:00
menubar Add Science category to menubar menu generation categories table. Fixes #2602 2019-01-21 11:58:44 -06:00
naughty dbus: fix nil notifications (#2180) 2018-10-07 16:09:12 +02:00
wibox Change the way the shape is done in the background container 2019-01-27 11:42:36 +01:00
beautiful.lua Add pointless naughty.lua and beautiful.lua files (#1259) 2016-12-08 23:53:50 +01:00
naughty.lua Add pointless naughty.lua and beautiful.lua files (#1259) 2016-12-08 23:53:50 +01:00