From 2eed23700905b8e6b129d686b0b00d091785f8b4 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 18 Aug 2009 18:11:18 +0200 Subject: [PATCH] screen: use signal_object_emit Signed-off-by: Julien Danjou --- screen.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/screen.c b/screen.c index d70bf7a9..5edf6cc8 100644 --- a/screen.c +++ b/screen.c @@ -510,18 +510,9 @@ luaA_screen_remove_signal(lua_State *L) void screen_emit_signal(lua_State *L, screen_t *screen, const char *name, int nargs) { - signal_t *sigfound = signal_array_getbyid(&screen->signals, - a_strhash((const unsigned char *) name)); - if(sigfound) - foreach(func, sigfound->sigfuncs) - { - luaA_pushscreen(L, screen); - for(int i = 0; i < nargs; i++) - lua_pushvalue(L, - nargs - 1); - luaA_object_push(L, (void *) *func); - luaA_dofunction(L, nargs + 1, 0); - } - lua_pop(L, nargs); + luaA_pushscreen(L, screen); + lua_insert(L, - nargs - 1); + signal_object_emit(L, &screen->signals, name, nargs + 1); } /** Emit a signal to a screen.