Improves separation of concerns for individual steps and reworks
groups and names for clearer output on error.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
With the overflow layout, it is now possible to allow theoretically
infinite space for widgets to draw into. The `fixed` layout was broken
for this use case.
To determine the total amount of space used by its child widgets, the
`fixed` layout would subtract their size from the total available space
during `:fit` and keep that as a "remaining size" variable.
However, `Infinity - x == Infinity` (when `x < Infinity`).
So `:fit` would always end up with a calculation `needed_size =
available_size - size_left` or `x = Infinity - Infinity`, which is `0`.
So with infinite space available, the `fixed` layout would actually
report a size of `0`.
See also discussion at
https://github.com/awesomeWM/awesome/pull/3309#issuecomment-997191875
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
Fix mouse movement detection when the widget has been transformed by
something like `wibox.container.rotate`.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
While it is possible for any widget to clip drawing for its children to
prevent drawing outside the widget's boundaries, the widget system would
still consider the child widget's full size for mouse clicks.
Draw clipping via Cairo supports any arbitrary, complex path. To mirror
that for mouse clicks, we would need to create a temporary Cairo surface
to do the clipping for us, which is rather expensive.
Therefore this patch only adds the very basic, but likely the most
common use case where mouse clicks should be clipped to the widget's own
size.
See https://github.com/awesomeWM/awesome/pull/3309#discussion_r611138512
for the full discussion.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
For some of the examples, the layout's available space was big enough to
show all child widgets, and no scrollbar was rendered.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
This layout adds overflow behavior:
- adds a scrollbar, configurable as a widget
- adds scrollbar dragging to scroll
- adds mouse scroll behavior
- allows children to render at (near) infinite size in scroll direction
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
It looked horrible/buggy when combined. Now it looks like people would
expect it to work. Another problem was the `bar_border_width` look
when `ticks` was `true.
luajit was failing to GC the notification about 5% of the time. This
commit stores all widget notifications in a weak table and don't let
any lambda access the parent object notification object.
Each of those changes reduces the failure rate. There might still be
a couple in there, but the test passed 200x on my laptop with 100%
success rate.