thread at PR 3448. PR 3448 involves changes to expand the content
(screenshot) API. Originally, I added both root.content() and and
screen.content to the C source, as client.content has always been
handled. However, screen.content in effect takes a root screenshot and
returns a crop of it. This can just as easily be done through Lua.
When this quick update was implemented in github, the code added to
awful.screen.lua was not quite correct. These changes represent the
debugged version. Users can now call s.content for a screen object, s,
and the screenshot will work transparently.
Signed Off: Brian Sobulefsky <brian.sobulefsky@protonmail.com>
It makes the shims impossible to implement without a double free,
a memory leak or a crash. Using `capi` should not require to
destroy the LGI wrappers.
Another example, not fixed in this commit, are the client shapes.
`gears.wallpaper` is a flat API (that doesn't even belong in gears) and
is neither well integrated with the other AwesomeWM concepts, nor well
documented or easy to understand for newcomers.
This module adds an object oriented, declarative, module with properties
for the most common wallpaper types. It also integrates with
`awful.placement` and the `wibox` module.
The design attempts to make the wallpaper a "wibox like" object like
the titlebars. It is non-interactive, but still allows the widgets. Note
that this is slow and should be avoided for dynamic content. It is why
the widgets are never updated unless manually reloaded. The objects also
attempt to be disposable rather than persistent. Thus they are immutable
by default to prevent accidental abuse.
Fix#3428#2596
Two calls to gdebug.print_warning() in run_with_keybindings use an
argument that concatenates a fixed string with the result returned by a
call to gdebug.dump(). gdebug.dump() is the debug library function for
immediate printing. It has no return value. This causes the correct
message in print_warning to not be printed, and also causes a
naughty.notify box to appear warning of an attempt to concatenate to an
empty variable.
The call to gdebug.print_warning should have an argument made by
concatenating to gdebug.dump_return(). Incidentally, this is in fact the
function used internally by gdebug.print().
Signed off by: Brian Sobulefsky <brian.sobulefsky@protonmail.com>
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>