hooks: call tags hooks with more arg

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-27 14:22:26 +01:00
parent f36cb984e3
commit 1a7413d257
2 changed files with 10 additions and 4 deletions

View File

@ -116,7 +116,8 @@ luaA_hooks_clients(lua_State *L)
}
/** Set the function called on each screen tag list change.
* This function is called with a screen number as argument.
* This function is called with a screen number as first argument,
* the tag object as second and the action (add or remove) as third.
* \param L The Lua VM state.
* \return The number of elements pushed on stack.
* \luastack

11
tag.c
View File

@ -103,7 +103,9 @@ tag_append_to_screen(tag_t *tag, screen_t *s)
if(globalconf.hooks.tags != LUA_REFNIL)
{
lua_pushnumber(globalconf.L, s->index + 1);
luaA_dofunction(globalconf.L, globalconf.hooks.tags, 1, 0);
luaA_tag_userdata_new(globalconf.L, tag);
lua_pushliteral(globalconf.L, "add");
luaA_dofunction(globalconf.L, globalconf.hooks.tags, 3, 0);
}
}
@ -127,7 +129,6 @@ tag_remove_from_screen(tag_t *tag)
ewmh_update_net_desktop_names(phys_screen);
ewmh_update_workarea(phys_screen);
tag->screen = SCREEN_UNDEF;
tag_unref(&tag);
/* resave tag prop of all clients so the number of tag will be the
* same */
@ -138,8 +139,12 @@ tag_remove_from_screen(tag_t *tag)
if(globalconf.hooks.tags != LUA_REFNIL)
{
lua_pushnumber(globalconf.L, screen + 1);
luaA_dofunction(globalconf.L, globalconf.hooks.tags, 1, 0);
luaA_tag_userdata_new(globalconf.L, tag);
lua_pushliteral(globalconf.L, "remove");
luaA_dofunction(globalconf.L, globalconf.hooks.tags, 3, 0);
}
tag_unref(&tag);
}
/** Tag a client with specified tag.