awesome/lib
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 tasklist: Fix documented function names (#3276) 2021-03-22 15:28:53 -07:00
beautiful client: Turn `rc.lua` logic into a new `request::border` signal. 2020-01-11 15:43:11 -08:00
gears fix(doc): gears.table.keys: s/integer keys/integer/ (#3293) 2021-03-22 12:05:17 -07:00
menubar Merge pull request #3070 from aDogCalledSpot/menubar_match_empty 2020-05-04 01:45:51 -07:00
naughty naughty: Correctly notify the client when a notification is dismissed. (#3184) 2021-03-22 00:03:37 -07:00
ruled `ruled.client` fixes (#3195) 2021-03-22 00:04:13 -07:00
wibox layout/fixed: Fix wrong space calculation in fit 2021-03-26 16:11:01 +03: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