Commit Graph

10274 Commits

Author SHA1 Message Date
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
Shay Agroskin 749422100e layout/fixed: Remove code duplication
The function has several expressions of the form
    if self._private.dir == "y" then
This patch stores the result of
    self._private.dir == "y"
to avoid code duplication.

Also remove the 'used_in_dir' and 'in_dir' variables since their values
can be calculated using other variables in the function and updating
them individually is error prone.

This patch doesn't do any functional changes.

Signed-off-by: Shay Agroskin <agrosshay@gmail.com>
2021-03-26 16:11:01 +03:00
James R aeb2d85dad
tasklist: Fix documented function names (#3276) 2021-03-22 15:28:53 -07:00
Jonas Belouadi ce5196424e
Docs: Fix code example for cairo usage. (#3295) 2021-03-22 15:05:46 -07:00
Emmanuel Lepage Vallée d583129eb6
Merge pull request #3143 from Elv13/doc_client_layout
Document the client layout properties
2021-03-22 12:10:36 -07:00
Emmanuel Lepage Vallée 98884cb3df
Apply suggestions from code review
Co-authored-by: Aire-One <Aire-One@users.noreply.github.com>
2021-03-22 12:10:06 -07:00
Daniel Hahler dab84c2662
fix(doc): gears.table.keys: s/integer keys/integer/ (#3293) 2021-03-22 12:05:17 -07:00
Emmanuel Lepage Vallée 80a7d9e3ee
Merge pull request #3283 from sclu1034/issue/3214
Remove unused first parameter in some constructors
2021-03-22 10:45:18 -07:00
Lucas Schwiderski 5fb6109439
Fix shadowing value in slider unit test
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-22 09:26:43 +01:00
Emmanuel Lepage Vallee b4cf88f4c0 doc: Fix the titlebars widget constructor doc 2021-03-22 00:56:02 -07:00
Emmanuel Lepage Vallee 31fcce436c doc: Add a client border color example. 2021-03-22 00:56:02 -07:00
Emmanuel Lepage Vallee 9e755d59ea shims: Minor fixes
* Allow tags to be passed to the client (fake) constructor
 * Add the border color fallback
2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee 8f8d0e7bbf doc: Fix a awful.ewmh->awful.permissions rebase issue 2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee 8fb4e2b721 doc: Add a client "sticky" example. 2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee 522d628c2c doc: Complete the widget documentation page.
This adds the `awful.widget` content along with some images.
2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee ac0aeb65c0 doc: Modernize the landing page.
The previous index.html was scary and the most useful links were
at the bottom. This commit fixes that.

It also adds an image of the default config with some labels to name
all visible components.
2021-03-22 00:54:00 -07:00
Uli Schlachter 1792780cf3 I want to see the error message!!! 2021-03-22 00:54:00 -07:00
Uli Schlachter 97a60818c4 Another ugly hack to get Travis to show output 2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallee 9f50c5e062 doc: Add more tag images. 2021-03-22 00:54:00 -07:00
Emmanuel Lepage Vallée 1c8b0b924d
`ruled.client` fixes (#3195)
* ruled.client: Fix a regression introduced when append/remove was added.

* ruled.client: Fix an error message grammar.
2021-03-22 00:04:13 -07:00
Emmanuel Lepage Vallée 50fa1b8679
naughty: Correctly notify the client when a notification is dismissed. (#3184)
Fix #3182

Co-authored-by: Uli Schlachter <psychon@znc.in>
2021-03-22 00:03:37 -07:00
Emmanuel Lepage Vallee 42a86efa50 doc: Document some of the `tag` properties. 2021-03-21 23:58:05 -07:00
Emmanuel Lepage Vallee 9b4f5b7969 doc: Add an example for mouse `snap` and client edge tiling. 2021-03-21 23:58:05 -07:00
Emmanuel Lepage Vallee a39f66e1c6 doc: Add an example for the client struts. 2021-03-21 23:58:05 -07:00
Emmanuel Lepage Vallee 1cbd839084 tests: "Complete" the screen template.
This isn't very nice code, far from it. But it renders fine. So,
as mentionned like what, 1.5 years ago, the original code dump was
half of the scope. This is the second half. It it has various sizes
for various core objects. All of them are hardcoded and some off by
a few pixels, but overall it works.
2021-03-21 23:58:05 -07:00
Emmanuel Lepage Vallee d9514820ef mouse: Add an `awful.mouse.snap.aerosnap_distance` global variable.
The distance to snap clients to each other was already something which
could be configured. The distance to enable screen edge wasn't.

Fixes #3025
2021-03-21 23:58:05 -07:00
Emmanuel Lepage Vallee f982cecd6b tests: Fix a regression in the placement rendering.
One is a real bug introduced by some ruled.client changes which
cause the clients to be moved twice in the first loop. This needs
fixing, but is mitigated for the doc.

The other is mostly fixed in the last commit and was a shim bug.
2021-03-21 23:58:05 -07:00
Emmanuel Lepage Vallee e5a84e2fda shims: Prevent signals when setting the client geo to the same value. 2021-03-21 23:58:05 -07:00
Aire-One 8bdabb234b draft 2021-03-21 23:58:05 -07:00
Uli Schlachter 413d47d5a5
Merge pull request #3280 from sclu1034/issue/3270
Improve gears.shape module description.
2021-03-12 07:24:31 +01:00
Lucas Schwiderski bed737a29f
Add tests for widget constructors
Adds unit tests for the widget constructors that used to accept an
unused argument.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-08 20:09:58 +01:00
Lucas Schwiderski 08a1018775
Add changelog for breaking change
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-08 20:09:57 +01:00
Lucas Schwiderski ad1a28ced2
Remove unused first parameter in some constructors
Fixes #3214.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-03-08 20:09:41 +01:00
Lucas Schwiderski ca066e8d0f
Respect line column limit 2021-03-07 11:09:45 +01:00
Lucas Schwiderski a8d830f1e6
Improve gears.shape module description.
Fixes #3270.
2021-03-06 17:10:20 +01:00
jpkotta aba1cf398f
fix client:activate action mouse_center (#3257) 2021-02-28 23:03:14 -08:00
Uli Schlachter db330e0cfe
Make sure that c.name is never nil (#3251)
Fixes: https://github.com/awesomeWM/awesome/issues/3248
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-02-28 23:02:54 -08:00
mergify[bot] 4319b16110
Merge pull request #3249 from Grumph/gears_improvements
Make gears.string.*with functions more permissive
2021-01-27 20:19:03 +00:00
Grumph 4e36cf862f Add tests 2021-01-27 01:41:56 +01:00
Grumph f6a2306d1a Protect endswith and startswith from nil str
A nil parameter can mean an empty string (e.g. client.name), so we
just return false.
2021-01-26 17:58:25 +01:00
mergify[bot] 66b1780d85
Merge pull request #3221 from Jonta/patch-1
Grammar
2020-12-05 17:13:30 +00:00
Jonta 1c53c36eb7
Grammar 2020-12-05 16:17:45 +01:00
Unai 538586c170
textbox: print traceback on error (#3205) 2020-11-01 16:12:42 -08:00
mergify[bot] cc67a5b40b
Merge pull request #3199 from psychon/grid_direction_properties
Fix setters/getters for grid layout direction properties
2020-10-13 07:23:23 +00:00
Uli Schlachter f1871873aa Fix setters/getters for grid layout direction properties
Wow. This code was so weirdly broken, I have no words.

Fixes: https://github.com/awesomeWM/awesome/issues/3198
Signed-off-by: Uli Schlachter <psychon@znc.in>
2020-10-10 17:32:04 +02:00
mergify[bot] 9e67481ee9
Merge pull request #3197 from dpetzold/fix-awesome-client-example
Fix awesome-client example
2020-10-09 20:21:52 +00:00
Derrick Petzold f49687256d Make easier to cut-n-paste 2020-10-09 11:30:17 -07:00
Derrick Petzold d33d38e768 Fix awesome-client example 2020-10-09 11:27:37 -07:00
mergify[bot] 6f047e9468
Merge pull request #3125 from actionless/hotkeys-vimdiff
feat(awful: hotkeys_popup: vim): add vimdiff
2020-10-07 15:04:52 +00:00
Emmanuel Lepage Vallée ed6cdf87b1
Merge pull request #3187 from PlayerNameHere/master
Fix wibox.layout.stack:raise() returning prematurely and inserting the widget at the end instead of the start
2020-09-28 23:32:06 -07:00