awesome/spec
Shay Agroskin a18e3508f6 layout/fixed: Fix wrong space calculation in fit
The fit function is called twice in row.

- The first time it gets the maximum available width, and returns how
  much of it it needs (with 0 spacing it would be 477)

- The second time the available width it gets is the same as it returned
  last phase (and probably is expected to return the same result again)

The width fit requests is the total width of all widgets together + the
spacing (e.g. if each tag widget is 53 px and spacing is -10 then the
requested width 53 * 9 - 80).

The function tries to first fit all its widgets (the tag numbers) in the
amount of width it received, and only then adds the spacing to it. This
is problematic because in the second phase the widgets need to fit
themselves in the same width they requested earlier minus the spacing
(in case of negative spacing). This is of course impossible and so some
widgets are just not being drawn correctly.

This patch makes fit function take into account the spacing while
placing the widgets and not afterwards.

Also add unit-testing that test the bug described.

Signed-off-by: Shay Agroskin <agrosshay@gmail.com>
2021-03-26 16:11:01 +03:00
..
awful use user specified permission. 2020-03-08 05:04:40 -04:00
beautiful spec/beautiful: Don't print noise (#2612) 2019-01-26 12:54:31 -05:00
gears fix(doc): gears.table.keys: s/integer keys/integer/ (#3293) 2021-03-22 12:05:17 -07:00
menubar Aligning 'regex' with other PR / Minor readability improvements 2019-02-09 19:21:46 +11:00
wibox layout/fixed: Fix wrong space calculation in fit 2021-03-26 16:11:01 +03:00
preload.lua beautiful.init: Fix return values and improve doco. fixes: #2588 #2592 2019-01-25 22:56:41 +11:00