client: rename hide API

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-24 13:44:15 +02:00
parent 333d76d14e
commit 1f4e55e432
2 changed files with 15 additions and 27 deletions

View File

@ -1365,33 +1365,22 @@ luaA_client_unmanage(lua_State *L)
return 0;
}
/** Hide a client.
/** Hide or unhide a client.
* \param L The Lua VM state.
*
* \luastack
* \lvalue A client.
*/
static int
luaA_client_hide(lua_State *L)
luaA_client_hide_set(lua_State *L)
{
client_t **c = luaA_checkudata(L, 1, "client");
(*c)->ishidden = true;
globalconf.screens[(*c)->screen].need_arrange = true;
return 0;
}
/** Unhide a client.
* \param L The Lua VM state.
*
* \luastack
* \lvalue A client.
*/
static int
luaA_client_unhide(lua_State *L)
{
client_t **c = luaA_checkudata(L, 1, "client");
(*c)->ishidden = false;
globalconf.screens[(*c)->screen].need_arrange = true;
bool v = luaA_checkboolean(L, 2);
if(v != (*c)->ishidden)
{
(*c)->ishidden = v;
globalconf.screens[(*c)->screen].need_arrange = true;
}
return 0;
}
@ -1404,7 +1393,7 @@ luaA_client_unhide(lua_State *L)
* otherwise.
*/
static int
luaA_client_ishidden(lua_State *L)
luaA_client_hide_get(lua_State *L)
{
client_t **c = luaA_checkudata(L, 1, "client");
lua_pushboolean(L, (*c)->ishidden);
@ -1463,9 +1452,8 @@ const struct luaL_reg awesome_client_meta[] =
{ "mouse_resize", luaA_client_mouse_resize },
{ "mouse_move", luaA_client_mouse_move },
{ "unmanage", luaA_client_unmanage },
{ "hide", luaA_client_hide },
{ "unhide", luaA_client_unhide },
{ "ishidden", luaA_client_ishidden },
{ "hide_set", luaA_client_hide_set },
{ "hide_get", luaA_client_hide_get },
{ "mouse_add", luaA_client_mouse_add },
{ "mouse_remove", luaA_client_mouse_remove },
{ "__eq", luaA_client_eq },

View File

@ -53,9 +53,9 @@ local function client_display(tabindex, cl)
local p = tabbed[tabindex][1]
if cl and p ~= cl then
cl:unhide()
cl:hide(false)
cl:swap(p)
p:hide()
p:hide(true)
cl:focus_set()
tabbed[tabindex][1] = cl
@ -158,14 +158,14 @@ local function client_untab(cl)
table.remove(tabbed, tabindex)
end
c:unhide()
c:hide(false)
awful.hooks.userhook_call('untabbed', {c})
end
-- Untab all clients in a tabbed display
local function client_untab_all(tabindex)
for i,c in pairs(tabbed[tabindex][2]) do
c:unhide()
c:hide(false)
awful.hooks.userhook_call('untabbed', {c})
end