This fixes issue #280 as well, just as the previous commit does, because it was
decided that that issue should be about two different things.
Signed-off-by: Uli Schlachter <psychon@znc.in>
When you run a mousegrabber, the C code calls this callback when the pointer is
moved or when a button is pressed/released. However, the button state is totally
bogus on press/release events, always claiming that the button that was
pressed/released is the only button that is pressed (even for release events!).
This commit fixes up the code so that the button state after the press/release
event is passed to the mousegrabber callback function.
Fixes: #280
Signed-off-by: Uli Schlachter <psychon@znc.in>
Forgot to commit the change that adds _NET_FRAME_EXTENTS to the list of atoms
that we actually query for and export to the C code.
Signed-off-by: Uli Schlachter <psychon@znc.in>
In #152 I've changed the autofocus handler to emit the request::activate
signal, instead of setting client.focus only.
This is wrong IMHO, and can be annoying:
If you have two floating clients above a tiled / maximized one, and
close one of the floating ones, with the tiled one being the one
selected by autofocus, it will be raised above the other floating
client.
This is changed now to use the new `request::focus` signal instead.
This basically reverts 20cdb5d (#152), but allows for customizing this
behavior, by overriding the default `request::focus` handler
(`ewmh.focus`).
It would be nice if there was a helper to check if a window's content
isn't visible at all (i.e. covered by other windows), and that could be
used then by the (new) default handler for request::focus - raising the
client only, if it's completely covered by another window.
Fixes https://github.com/awesomeWM/awesome/issues/217
This still does `client.focus = c` by default, but allows to customize
it.
This was initially suggested in #194, but by using `request::activate`
instead, which would not be the same. Therefore a new signal is being
used instead.
Helped-by: Samir Benmendil <samir.benmendil@gmail.com>
This way "that other widget" doesn't prevent the current widget from being
garbage collected.
Please note that this in all of these cases the widget under consideration does
have a strong reference to the callback function. This means that the callback
cannot be garbage collected until "this widget" itself is collected. Thanks to
this, this change is safe.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Connecting to a signal weakly has the same effect as connecting to it strongly,
but it allows the garbage collector to disconnect the signal in case nothing
else references this function.
Signed-off-by: Uli Schlachter <psychon@znc.in>
After using sloppy mouse focus to select a client (which does not raise
it already), maximizing/fullscreening it should then raise it.
This also uses the new shortcut `c.maximized = not c.maximized`.
Closes https://github.com/awesomeWM/awesome/pull/270
This fixes "make (cmake)" picking up the files from the build dir itself
(recursively), i.e. "make cmake" would also create
`.build-HOST-x86_64-linux-gnu-4.9.2/.build-HOST-x86_64-linux-gnu-4.9.2/`.
It could also use `${AWE_SRCS}` etc here probably.
This improves the behaviour with print()ing for debugging, when the
output is redirected to a file.
I was using `setbuf(…, 0)` initially, but it makes sense to buffer it
per line. This uses `setvbuf` instead of `setlinebuf`, which might not
be available everywhere.
Closes https://github.com/awesomeWM/awesome/pull/267
Run the following code:
do
local d
local f = function() d.visible = true end
if _VERSION >= "Lua 5.2" then
setmetatable({}, { __gc = f })
else
getmetatable(newproxy(true)).__gc = f
end
d = drawin({})
end
collectgarbage("collect")
Awesome will segfault.
The reason for this is that after the above code ran, all variables in it are
unreferenced and will be garbage-collected at the next sweep phase. Lua runs
garbage collectors in the inverse order that their corresponding objects were
"marked" which means for the above code that the drawin's garbage collector will
run before function f runs. So the code will access the drawin after its
destructor already ran. Obviously, awesome's C code does not expect nor
correctly deal with this situation and was dereferencing a NULL pointer.
To fix this, this commit "unsets" the metatable of a userdata object when it is
being garbage collected. Since the type of a userdata is inferred via its
metatable, the object will no longer be accepted by luaA_toudata().
For the above code this will result in an unhelpful error message saying that
something tried to index a userdata, but userdata cannot be indexed. At least we
no longer crash and the traceback of the error will hopefully point at some __gc
metamethod which should be enough of a hint to figure out the problem.
Thanks-to: http://blog.reverberate.org/2014/06/beware-of-lua-finalizers-in-c-modules.html
Signed-off-by: Uli Schlachter <psychon@znc.in>
Adding @AWESOME_VERSION@ to the LDoc description is useful to have on
the index page. While at it, it makes the description more
verbose/correct.
For docs/02-contributing.md, it lists the current aliases for typed
parameters, prefers/mentions `@tparam` and `@treturn` only, and fixes
some minor wording.
Closes#262.
Calling lua_tostring() on a number/integer, turns that stack slot into a string.
This patch changes the code to only call lua_tostring() if the function argument
really is a string.
This partly also caused https://github.com/awesomeWM/awesome/issues/238.
Signed-off-by: Uli Schlachter <psychon@znc.in>
In commit 3cbdc2a79f, the argument order for awful.layout.inc was changed
from (layouts, i, s) to (i, s, layouts), so that layouts can become an optional
parameter. However, this change (obviously) breaks user configs.
To hide this breakage, we assume the old argument order if the number i is a
table. This cannot break anything, since the operator "+" will error out on
tables anyway. :-)
Signed-off-by: Uli Schlachter <psychon@znc.in>