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>
This module is half way between the tooltip and the raw wibox.
It supports the following features:
* Auto resize to its widget size
* Support parent objects and placement
Fix#1683
If the `layouts` are set during initialization, `t.layout` will
return `floating` if `t.layouts` is added before `t.layout`. By
using the raw layout, the fallback doesn't kicks in.
Commit ac8af66005 added beautiful.theme_path, which is used to save the
directory that contains the theme file that was loaded. Just two months
later, commit ca12473584 broke this code by adding a __newindex
metamethod. This caused the assignment to beautiful.theme_path to be
redirected to the theme. However, the theme is immediately replaced by
beautiful.init() after setting up the theme_path, so this assignment got
lost.
Fix this by using rawset() to bypass the metamethod.
Fixes: https://github.com/awesomeWM/awesome/issues/2573
Signed-off-by: Uli Schlachter <psychon@znc.in>
* Makefile: all: only depend on cmake-build
Previously `make` would first run `cmake-build` (`make` in `build/`),
and then run `make -C build awesome` afterwards again (which gets built
by the first step already).
* Makefile: get rid of cmake-build
* Travis: testing previous commits: make distclean
Otherwise it might fail due to permission errors for existing files:
https://travis-ci.org/awesomeWM/awesome/jobs/476612117#L2785
-- Build files have been written to: /home/travis/build/awesomeWM/awesome/build
[ 1%] Generating manpages/man1/awesome.1
[ 2%] Generating manpages/man1/awesome.1.gz
/bin/sh: 1: cannot create /home/travis/build/awesomeWM/awesome/build/manpages/man1/awesome.1.gz: Permission denied
make[3]: *** [manpages/man1/awesome.1.gz] Error 2
make[2]: *** [CMakeFiles/man.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [cmake-build] Error 2
* cmake: use add_custom_target/add_dependencies instead of CHECK_TARGETS
This makes it fail in case of errors explicitly. Previously appending
to CHECK_TARGETS in tests/examples/CMakeLists.txt was silently ignored.
* cmake: check: depend on check-unit always
Without busted this will print a message only, but that is good to have.
(I was confused why "check" would not depend on "check-unit" when
looking at the generated Makefile (which was caused due to some luarocks
environment being active without busted))
`awesome-client 'return 1' 'return 2'` would only run the first command.
This also fixes other issues reported by shellcheck, and uses `read`
directly to allow `shellcheck` to parse that construct correctly.