client: return instance and class (FS#236)
The problem seems to be that while a function can return multiple values, an index cannot. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
7ec624cc14
commit
982a8e4c52
19
client.c
19
client.c
|
@ -1199,7 +1199,8 @@ luaA_client_newindex(lua_State *L)
|
|||
* \return The number of elements pushed on stack.
|
||||
* \luastack
|
||||
* \lfield name The client title.
|
||||
* \lfield class The client class, 2 strings long.
|
||||
* \lfield class The client class.
|
||||
* \lfield instance The client instance.
|
||||
* \lfield pid The client PID, if available.
|
||||
* \lfield floating_placement The floating placement used for this client.
|
||||
* \lfield screen Client screen number.
|
||||
|
@ -1232,13 +1233,15 @@ luaA_client_index(lua_State *L)
|
|||
lua_pushstring(L, (*c)->name);
|
||||
break;
|
||||
case A_TK_CLASS:
|
||||
if(xutil_get_class_hint(globalconf.connection, (*c)->win, &hint))
|
||||
{
|
||||
lua_pushstring(L, hint.res_name);
|
||||
lua_pushstring(L, hint.res_class);
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
if(!xutil_get_class_hint(globalconf.connection, (*c)->win, &hint))
|
||||
return 0;
|
||||
lua_pushstring(L, hint.res_class);
|
||||
break;
|
||||
case A_TK_INSTANCE:
|
||||
if(!xutil_get_class_hint(globalconf.connection, (*c)->win, &hint))
|
||||
return 0;
|
||||
lua_pushstring(L, hint.res_name);
|
||||
break;
|
||||
case A_TK_PID:
|
||||
prop_c = xcb_get_property_unchecked(globalconf.connection, false, (*c)->win, _NET_WM_PID, CARDINAL, 0L, 1L);
|
||||
prop_r = xcb_get_property_reply(globalconf.connection, prop_c, NULL);
|
||||
|
|
|
@ -27,6 +27,7 @@ hide
|
|||
honorsizehints
|
||||
icon_path
|
||||
image
|
||||
instance
|
||||
label
|
||||
layout
|
||||
left
|
||||
|
|
Loading…
Reference in New Issue