client: check clients are different when swapping

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-14 10:36:15 +01:00
parent ab804f689d
commit d7784697cb
1 changed files with 10 additions and 6 deletions

View File

@ -1033,6 +1033,9 @@ luaA_client_swap(lua_State *L)
{ {
client_t **c = luaA_checkudata(L, 1, "client"); client_t **c = luaA_checkudata(L, 1, "client");
client_t **swap = luaA_checkudata(L, 2, "client"); client_t **swap = luaA_checkudata(L, 2, "client");
if(*c != *swap)
{
client_list_swap(&globalconf.clients, *swap, *c); client_list_swap(&globalconf.clients, *swap, *c);
client_need_arrange(*c); client_need_arrange(*c);
client_need_arrange(*swap); client_need_arrange(*swap);
@ -1040,6 +1043,7 @@ luaA_client_swap(lua_State *L)
/* Call hook to notify list change */ /* Call hook to notify list change */
if(globalconf.hooks.clients != LUA_REFNIL) if(globalconf.hooks.clients != LUA_REFNIL)
luaA_dofunction(L, globalconf.hooks.clients, 0, 0); luaA_dofunction(L, globalconf.hooks.clients, 0, 0);
}
return 0; return 0;
} }