Move the burdensome legacy code into local function so the normal
`gears.table.crush` module setup can be used. This fixes a couple
monior issues where `args` would be ignored.
This also makes a minor change to the logic. Changing the position
always moves to wibar to the end of the stack. Previously, there
was a minor case where it would not. There was also the case when
setting the same position twice would move the wibar, which was a bug.
This was lost in 3.5->4.0 update, but still had some references in
the code and doc. At the time, the plan was to add it back
"shortly after" based on the `awful.placement` code, but it was
never merged.
Previously, it only added 1 of the 2 sides of the relevant margins
to the struct size. For example, if the position was "top", then
only the top margin was added, not the bottom one.
Without this change, if a composed placement was used, it would leak
the "override_geometry" in the args, which would be kept cached during
the next composed node. If that node had no override of its own, it
would use the previous one by accident.
In practice, it means it was impossible to resize a `wibar` manually.
The `wibar` would always restore itself to the height (or width, for
vertical ones) it previously had.
The constructor's documentation was worded as if it was a getter, which
lead to unexpected behaviour where subsequent calls for the same client
replaced previous titlebars.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
Replace the `awful.keygroup` property by an table that can be used
as an enum to point to the `awful.keygroups` definitions.
The previous field for `awful.keygroup` was empty (even no-existant),
and was here only to appear in the documentation as a definition for
the valid values to target keygroups.
With this new enum style table, the user can easily refere to keygroups
the same way we did for mouse buttons.
When stopping a keygrabber with a timeout manually or through the stop
key, the timer would continue and call the stop callback again some time
later.
The error message in `gears.timer:stop` is removed, since there actually
is no harm in just returning immediately. And the timer implementation
itself calls `:stop` in certain places without checking for `.started`,
which lead to a situation where the internal call to `stop` triggered
the error message.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
While the documentation already specified the signal via `@emits`, it
did not make it clear that this signal is emitted on a `tag` object,
rather than the `client`.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
The behaviour of `c:to_selected_tags()` does not match what one would
have expected from its short description.
The behaviour also doesn't really match the method's name, but since
this is already in use, I won't change functionality or names here.
Instead this extends the method's documentation to accurately reflect
its implementation and also point users to the functionality that they
were likely looking for based on the method's name.
Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>