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.
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.
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>
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>
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>
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>
widget_at() no longer exists since 0aa4304bda (and the surrounding commits
stopped us using this function).
Signed-off-by: Uli Schlachter <psychon@znc.in>
The magnifier layout wants to ignore floating clients. Before 82342f0 this was
done by calling awful.client.floating.get(focus). If "focus" was nil, this might
have checked the floating status of a wrong client (if some other client was
focused, and the code in magnifier set focus=nil before). This issue can easily
be missed and might exist since forever. After 82342f, floating status is
checked via "focus.floating" and this now causes an "attempt to index nil value"
error instead. Much easier to notice.
Fix this by adding the missing nil check and while touching the code, merge this
with the previous "if" and correct another error (the wrong thing happened if we
had #cls=0).
Fixes: https://github.com/awesomeWM/awesome/issues/1103
Signed-off-by: Uli Schlachter <psychon@znc.in>