From 6666060d87325083dc5cdaeee176004343725278 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 18 Sep 2008 15:07:34 +0200 Subject: [PATCH] client: introduce isvisible() Signed-off-by: Julien Danjou --- client.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/client.c b/client.c index 8513a28c..a19df7c5 100644 --- a/client.c +++ b/client.c @@ -876,6 +876,7 @@ client_kill(client_t *c) /** Get all clients into a table. * \param L The Lua VM state. + * \return The number of elements pushed on stack. * \luastack * \lreturn A table with all clients. */ @@ -898,6 +899,7 @@ luaA_client_get(lua_State *L) /** Get only visible clients for a screen (DEPRECATED). * \param L The Lua VM state. + * \return The number of elements pushed on stack. * \luastack * \lparam A screen number. * \lreturn A table with all visible clients for this screen. @@ -925,6 +927,21 @@ luaA_client_visible_get(lua_State *L) return 1; } +/** Check if a client is visible on its screen. + * \param L The Lua VM state. + * \return The number of elements pushed on stack. + * \luastack + * \lvalue A client. + * \lreturn A boolean value, true if the client is visible, false otherwise. + */ +static int +luaA_client_isvisible(lua_State *L) +{ + client_t **c = luaA_checkudata(L, 1, "client"); + lua_pushboolean(L, client_isvisible(*c, (*c)->screen)); + return 1; +} + /** Set client border width. * \param c The client. * \param width The border width. @@ -1545,6 +1562,7 @@ const struct luaL_reg awesome_client_methods[] = }; const struct luaL_reg awesome_client_meta[] = { + { "isvisible", luaA_client_isvisible }, { "coords", luaA_client_coords }, { "fullcoords", luaA_client_fullcoords }, { "buttons", luaA_client_buttons },