mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
global signals use signal_object_emit
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
2eed237009
commit
3105663933
1 changed files with 1 additions and 14 deletions
15
luaa.c
15
luaa.c
|
@ -650,20 +650,7 @@ luaA_awesome_remove_signal(lua_State *L)
|
|||
static int
|
||||
luaA_awesome_emit_signal(lua_State *L)
|
||||
{
|
||||
const char *name = luaL_checkstring(L, 1);
|
||||
signal_t *sigfound = signal_array_getbyid(&global_signals,
|
||||
a_strhash((const unsigned char *) name));
|
||||
if(sigfound)
|
||||
{
|
||||
int nargs = lua_gettop(L) - 1;
|
||||
foreach(ref, sigfound->sigfuncs)
|
||||
{
|
||||
for(int i = 0; i < nargs; i++)
|
||||
lua_pushvalue(L, - nargs);
|
||||
luaA_object_push(L, (void *) *ref);
|
||||
luaA_dofunction(L, nargs, 0);
|
||||
}
|
||||
}
|
||||
signal_object_emit(L, &global_signals, luaL_checkstring(L, 1), lua_gettop(L) - 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue