client: add support for WM_WINDOW_ROLE access
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
531005453a
commit
442eb739c7
|
@ -248,7 +248,16 @@ keybinding({ modkey, "Ctrl" }, "i", function ()
|
||||||
if mypromptbox.text then
|
if mypromptbox.text then
|
||||||
mypromptbox.text = nil
|
mypromptbox.text = nil
|
||||||
else
|
else
|
||||||
mypromptbox.text = "Class: " .. client.focus.class .. " Instance: ".. client.focus.instance
|
mypromptbox.text = nil
|
||||||
|
if client.focus.class then
|
||||||
|
mypromptbox.text = "Class: " .. client.focus.class .. " "
|
||||||
|
end
|
||||||
|
if client.focus.instance then
|
||||||
|
mypromptbox.text = mypromptbox.text .. "Instance: ".. client.focus.instance .. " "
|
||||||
|
end
|
||||||
|
if client.focus.role then
|
||||||
|
mypromptbox.text = mypromptbox.text .. "Role: ".. client.focus.role
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end):add()
|
end):add()
|
||||||
|
|
||||||
|
|
8
client.c
8
client.c
|
@ -1257,6 +1257,7 @@ luaA_client_newindex(lua_State *L)
|
||||||
* \lfield class The client class.
|
* \lfield class The client class.
|
||||||
* \lfield instance The client instance.
|
* \lfield instance The client instance.
|
||||||
* \lfield pid The client PID, if available.
|
* \lfield pid The client PID, if available.
|
||||||
|
* \lfield role The window role, if available.
|
||||||
* \lfield machine The machine client is running on.
|
* \lfield machine The machine client is running on.
|
||||||
* \lfield icon_name The client name when iconified.
|
* \lfield icon_name The client name when iconified.
|
||||||
* \lfield floating_placement The floating placement used for this client.
|
* \lfield floating_placement The floating placement used for this client.
|
||||||
|
@ -1307,6 +1308,13 @@ luaA_client_index(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
lua_pushstring(L, hint.res_name);
|
lua_pushstring(L, hint.res_name);
|
||||||
break;
|
break;
|
||||||
|
case A_TK_ROLE:
|
||||||
|
if(!xutil_text_prop_get(globalconf.connection, (*c)->win,
|
||||||
|
WM_WINDOW_ROLE, &value, &slen))
|
||||||
|
return 0;
|
||||||
|
lua_pushlstring(L, value, slen);
|
||||||
|
p_delete(&value);
|
||||||
|
break;
|
||||||
case A_TK_PID:
|
case A_TK_PID:
|
||||||
prop_c = xcb_get_property_unchecked(globalconf.connection, false, (*c)->win, _NET_WM_PID, CARDINAL, 0L, 1L);
|
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);
|
prop_r = xcb_get_property_reply(globalconf.connection, prop_c, NULL);
|
||||||
|
|
|
@ -44,3 +44,4 @@ WM_STATE
|
||||||
_NET_WM_WINDOW_OPACITY
|
_NET_WM_WINDOW_OPACITY
|
||||||
_NET_SYSTEM_TRAY_ORIENTATION
|
_NET_SYSTEM_TRAY_ORIENTATION
|
||||||
WM_CHANGE_STATE
|
WM_CHANGE_STATE
|
||||||
|
WM_WINDOW_ROLE
|
||||||
|
|
|
@ -45,6 +45,7 @@ plot_properties_set
|
||||||
position
|
position
|
||||||
resize
|
resize
|
||||||
right
|
right
|
||||||
|
role
|
||||||
screen
|
screen
|
||||||
selected
|
selected
|
||||||
shadow
|
shadow
|
||||||
|
|
Loading…
Reference in New Issue