From 1f4e55e432438bbfdffb66b83c5450be78d1c992 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 24 Jun 2008 13:44:15 +0200 Subject: [PATCH] client: rename hide API Signed-off-by: Julien Danjou --- client.c | 34 +++++++++++----------------------- lib/tabulous.lua | 8 ++++---- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/client.c b/client.c index 3d4353bf..c9d14e00 100644 --- a/client.c +++ b/client.c @@ -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 }, diff --git a/lib/tabulous.lua b/lib/tabulous.lua index 050b4f23..f930b94c 100644 --- a/lib/tabulous.lua +++ b/lib/tabulous.lua @@ -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