This re-use the `align` code for the existing `centered`,
`center_horizontal` and `center_vertical` methods. It also
add all the other edges and corners alias.
This allow to place a client, wibox or cursor at the
edges, corners or center of the parent geometry.
This also add code from `awful.wibox` to ajust the workarea.
Future commit will use `awful.placement` to place `awful.wibox`.
This fixes a race where we would keep giving the old wallpaper surface to Lua
when a new one was set, because we didn't get the "wallpaper changed"-event yet.
Fix this by just keeping the surface we use for setting the wallpaper around.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of querying the wallpaper every time that root.wallpaper() is called, we
just remember it in globalconf.
Signed-off-by: Uli Schlachter <psychon@znc.in>
p_dup really only duplicates the given region of memory. It does not append a
zero byte. Thus, the string we are using here was not zero-terminated.
Fix this by just using lua_pushlstring() so that we do not have to worry about a
null terminating the string at all.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This gives us the worst of both worlds: We still restart on RandR screen changes
and the information about screens isn't available during startup. However, it's
a step in the right direction, because all Lua code will now have to handle
kind-of-dynamic screen changes.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This adds gears.screen which contains a wrapper around
screen.connect_signal("added", func) that also calls the callback function for
each screen that already exists. This is added in gears.screen so that it can
also be used from e.g. wibox, if needed. Feel free to move this elsewhere if
that's a bad idea (I'm not really convinced of it).
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of using a special _call field on gears.matrix instances which has to be
copied around suitably, this commit changes the code so that the magic is
restricted to a single function in gears.shape.transform. With some metatable
magic, suitable redirection to everything is added.
Signed-off-by: Uli Schlachter <psychon@znc.in>