This creates a new helper function for setting the transient_for property of a
client. This is a preparation for a following commit. No behaviour changes
intended.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit makes awful.ewmh re-apply the maximized geometry to any maximized
clients when the workarea of a screen changes. This happens e.g. when a wibox
that is docked to the edge of the screen is hidden.
Fixes: https://github.com/awesomeWM/awesome/issues/705
Signed-off-by: Uli Schlachter <psychon@znc.in>
This avoids having to mock half the C API just because all of awful is loaded
needlessly in this unit test and is generally a good idea.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The argument to luaL_checkstack() is the amount of new stack to make available,
not the new size of the stack. Thus, remove the addition of lua_gettop(L) here.
Signed-off-by: Uli Schlachter <psychon@znc.in>
In various conditions, luaA_loadrc() left luaA_dofunction_on_error and an error
message on the Lua stack. Also, it used LUA_MULTRET without looking at the
return values. Fix all of this and reorder the code a bit to make it easier to
follow.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The Lua stack is a finite resource and everything that pushes something there
should also clean up. This is not a problem for functions that are called by
Lua, because their "stack frame" is freed when they return. However, in global
context, Lua does not and cannot automatically clean up for us. Thus, it makes
sense to print a warning in this case.
(Additionally, this cleans up the stack if something is left)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit adds a new "luacheck" target to the Makefiles. This target is
automatically included in "make check" when luacheck is found in $PATH.
Additionally, this includes luacheck in Travis so that the build fails when
luacheck complains about something.
Signed-off-by: Uli Schlachter <psychon@znc.in>
To quote from ICCCM (§4.1.2): "The window manager will not change properties
written by the client."
We tried to do this anyway to update WM_HINTS so that the current urgency state
is reflected. Apparently, Chrome does a similar read-modify-set cycle and the
resulting race condition meant that the "accepts input" hint on Chromium's
window was permanently disabled.
This helps with https://github.com/awesomeWM/awesome/issues/670, but I still
think that Chrome shouldn't try to implement "please don't focus me when I do
the following" by temporarily claiming "please don't ever focus me".
Signed-off-by: Uli Schlachter <psychon@znc.in>
Step 1 starts a client and uses awful.rules to move it to a not-selected tag.
Because this rule still has focus=true, this calls awful.ewmh.activate() via the
request::activate signal. This function makes the client urgent because it is on
a not-selected tag.
Step 3 does the same thing, but also uses switchtotag=true. Now
awful.ewmh.activate() doesn't make the client urgent because it successfully
focused this client. However, the test was wrongly assuming that the client
became urgent (copy&paste error? I don't know).
The fix is of course not to require the client to become urgent.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Since commit b2aaefd095, we correctly handle window gravities when
the border width of a client changes. Since most windows out there have a
NorthWest gravity, this means that most windows do not have this problem.
However, e.g. mplayer uses gravity "Static" and this causes this issue (any
gravity other than NorthWest will do).
This affects the fullscreen handling in awful.ewmh. The code has to set the
border width before it changes a client's geometry so that the move when the
border width changes doesn't matter.
No new integration test for this since I didn't find anything usable with a
non-NorthWest gravity. A test would be easy to write, just test if `c.fullscreen
= true ; c.fullscreen = false` restores the previous window geometry.
Fixes: https://github.com/awesomeWM/awesome/issues/697
Signed-off-by: Uli Schlachter <psychon@znc.in>
Lua 5.3's build system provides the LUA_COMPAT_5_2 and LUA_COMPAT_5_1 defines to
enable some compatibility with these older Lua versions. LUA_COMPAT_5_2 is
defined by default while LUA_COMPAT_5_1 is not.
This commit also disables LUA_COMPAT_5_2 on the Lua version that we build on
Travis so that the build will hopefully break if some feature is used that was
removed.
Signed-off-by: Uli Schlachter <psychon@znc.in>
awful.layout.suit.corner does awful.tag.getmfpol(t), but doesn't actually have a
variable t in scope. I just copied the needed stuff from the tile layout.
Signed-off-by: Uli Schlachter <psychon@znc.in>
No idea what the correct value for this argument is supposed to be, but since
there is no variable "m" in scope, this always uses nil as the value.
Signed-off-by: Uli Schlachter <psychon@znc.in>
There is no "s" variable. This code wants "screen" instead. The effect of this
typo was that with multiple taglists, only the one that was created last got
updated.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of copying images to ${BUILD_DIR}/docs/images, which is the directory
with the input to ldoc, this now copies the images to ${BUILD_DIR}/doc/images,
which is where ldoc generates its output. That way, the images are together with
the html files and are automatically picked up by a lot of stuff.
Fixes: https://github.com/awesomeWM/awesome/issues/681
Signed-off-by: Uli Schlachter <psychon@znc.in>
Currently, an error in the default config in the right place isn't noticed. Fix
this by doing two things:
- Also grep for "error" (this catches runtime errors with a stack trace)
- Make _runner print a "success" message at the end and also grep for that
Fixes: https://github.com/awesomeWM/awesome/issues/689
Signed-off-by: Uli Schlachter <psychon@znc.in>
This means that titlebars, which are an important feature, get more testing. As
was recently shown, they don't get enough testing currently. Also, new users
will likely expect titlebars these days.
Everyone who doesn't want titlebars can easily disable them.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This module is partly broken since 2009 (the way to use it that is mentioned in
the docs doesn't actually work) because the mousefinder object doesn't have a
find()-method (the line doing "self.find = find" should do "self.finder =
finder.find"). Since no one really noticed, this module is apparently not used
much.
When someone wants to still use this, they are free to copy this to their own
config. It's not much code, but it's enough code that I am annoyed that we ship
something broken to users. Everyone who copies it to their own config will make
sure it works the way they want.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Both the test runner and the wibox use gears.timer.delayed_call(). The test
runner uses this to call steps and the wibox uses it to trigger redraws. When
running under LuaCov, the Lua code becomes slow enough that the wibox didn't
redraw yet when the leak check is run. This causes the check to fail, because
the client is still referenced by the tasklist and thus cannot be garbage
collected.
Fix this by waiting one more iteration before running the leak check.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Lots of our code depends on the C API and thus can only be tested when that is
available. Hence, it makes sense to also run the functional tests under LuaCov.
Signed-off-by: Uli Schlachter <psychon@znc.in>