client: rename hide API
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
333d76d14e
commit
1f4e55e432
34
client.c
34
client.c
|
@ -1365,33 +1365,22 @@ luaA_client_unmanage(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Hide a client.
|
/** Hide or unhide a client.
|
||||||
* \param L The Lua VM state.
|
* \param L The Lua VM state.
|
||||||
*
|
*
|
||||||
* \luastack
|
* \luastack
|
||||||
* \lvalue A client.
|
* \lvalue A client.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
luaA_client_hide(lua_State *L)
|
luaA_client_hide_set(lua_State *L)
|
||||||
{
|
{
|
||||||
client_t **c = luaA_checkudata(L, 1, "client");
|
client_t **c = luaA_checkudata(L, 1, "client");
|
||||||
(*c)->ishidden = true;
|
bool v = luaA_checkboolean(L, 2);
|
||||||
globalconf.screens[(*c)->screen].need_arrange = true;
|
if(v != (*c)->ishidden)
|
||||||
return 0;
|
{
|
||||||
}
|
(*c)->ishidden = v;
|
||||||
|
globalconf.screens[(*c)->screen].need_arrange = true;
|
||||||
/** 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;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1404,7 +1393,7 @@ luaA_client_unhide(lua_State *L)
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
luaA_client_ishidden(lua_State *L)
|
luaA_client_hide_get(lua_State *L)
|
||||||
{
|
{
|
||||||
client_t **c = luaA_checkudata(L, 1, "client");
|
client_t **c = luaA_checkudata(L, 1, "client");
|
||||||
lua_pushboolean(L, (*c)->ishidden);
|
lua_pushboolean(L, (*c)->ishidden);
|
||||||
|
@ -1463,9 +1452,8 @@ const struct luaL_reg awesome_client_meta[] =
|
||||||
{ "mouse_resize", luaA_client_mouse_resize },
|
{ "mouse_resize", luaA_client_mouse_resize },
|
||||||
{ "mouse_move", luaA_client_mouse_move },
|
{ "mouse_move", luaA_client_mouse_move },
|
||||||
{ "unmanage", luaA_client_unmanage },
|
{ "unmanage", luaA_client_unmanage },
|
||||||
{ "hide", luaA_client_hide },
|
{ "hide_set", luaA_client_hide_set },
|
||||||
{ "unhide", luaA_client_unhide },
|
{ "hide_get", luaA_client_hide_get },
|
||||||
{ "ishidden", luaA_client_ishidden },
|
|
||||||
{ "mouse_add", luaA_client_mouse_add },
|
{ "mouse_add", luaA_client_mouse_add },
|
||||||
{ "mouse_remove", luaA_client_mouse_remove },
|
{ "mouse_remove", luaA_client_mouse_remove },
|
||||||
{ "__eq", luaA_client_eq },
|
{ "__eq", luaA_client_eq },
|
||||||
|
|
|
@ -53,9 +53,9 @@ local function client_display(tabindex, cl)
|
||||||
local p = tabbed[tabindex][1]
|
local p = tabbed[tabindex][1]
|
||||||
|
|
||||||
if cl and p ~= cl then
|
if cl and p ~= cl then
|
||||||
cl:unhide()
|
cl:hide(false)
|
||||||
cl:swap(p)
|
cl:swap(p)
|
||||||
p:hide()
|
p:hide(true)
|
||||||
cl:focus_set()
|
cl:focus_set()
|
||||||
|
|
||||||
tabbed[tabindex][1] = cl
|
tabbed[tabindex][1] = cl
|
||||||
|
@ -158,14 +158,14 @@ local function client_untab(cl)
|
||||||
table.remove(tabbed, tabindex)
|
table.remove(tabbed, tabindex)
|
||||||
end
|
end
|
||||||
|
|
||||||
c:unhide()
|
c:hide(false)
|
||||||
awful.hooks.userhook_call('untabbed', {c})
|
awful.hooks.userhook_call('untabbed', {c})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Untab all clients in a tabbed display
|
-- Untab all clients in a tabbed display
|
||||||
local function client_untab_all(tabindex)
|
local function client_untab_all(tabindex)
|
||||||
for i,c in pairs(tabbed[tabindex][2]) do
|
for i,c in pairs(tabbed[tabindex][2]) do
|
||||||
c:unhide()
|
c:hide(false)
|
||||||
awful.hooks.userhook_call('untabbed', {c})
|
awful.hooks.userhook_call('untabbed', {c})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue