From 69b4b2650d6646ad01c7a2c942880d2807177a9b Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 21 Aug 2009 20:55:13 +0200 Subject: [PATCH] client: fix client signal emitting in set_icon Signed-off-by: Julien Danjou --- client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 95c9f8af..e03b9bc4 100644 --- a/client.c +++ b/client.c @@ -1375,10 +1375,13 @@ void client_set_icon(lua_State *L, int cidx, int iidx) { client_t *c = luaA_client_checkudata(L, cidx); + /* convert index to absolute */ + cidx = luaA_absindex(L, cidx); + iidx = luaA_absindex(L, iidx); luaA_checkudata(L, iidx, &image_class); luaA_object_unref_item(L, cidx, c->icon); c->icon = luaA_object_ref_item(L, cidx, iidx); - luaA_object_emit_signal(L, cidx, "property::icon", 0); + luaA_object_emit_signal(L, cidx < iidx ? cidx : cidx - 1, "property::icon", 0); /* execute hook */ hook_property(c, "icon"); }