client: fix client signal emitting in set_icon
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
6a4d04d4f2
commit
69b4b2650d
5
client.c
5
client.c
|
@ -1375,10 +1375,13 @@ void
|
||||||
client_set_icon(lua_State *L, int cidx, int iidx)
|
client_set_icon(lua_State *L, int cidx, int iidx)
|
||||||
{
|
{
|
||||||
client_t *c = luaA_client_checkudata(L, cidx);
|
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_checkudata(L, iidx, &image_class);
|
||||||
luaA_object_unref_item(L, cidx, c->icon);
|
luaA_object_unref_item(L, cidx, c->icon);
|
||||||
c->icon = luaA_object_ref_item(L, cidx, iidx);
|
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 */
|
/* execute hook */
|
||||||
hook_property(c, "icon");
|
hook_property(c, "icon");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue