client: store WM_CLIENT_MACHINE
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
f93c91cd1b
commit
0acb4aeff4
7
client.c
7
client.c
|
@ -548,6 +548,7 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int phys_screen,
|
|||
property_update_wm_hints(c, NULL);
|
||||
property_update_wm_transient_for(c, NULL);
|
||||
property_update_wm_client_leader(c, NULL);
|
||||
property_update_wm_client_machine(c);
|
||||
|
||||
/* Then check clients hints */
|
||||
ewmh_client_check_hints(c);
|
||||
|
@ -1731,11 +1732,7 @@ luaA_client_index(lua_State *L)
|
|||
lua_pushnumber(L, c->leader_win);
|
||||
break;
|
||||
case A_TK_MACHINE:
|
||||
if(!xutil_text_prop_get(globalconf.connection, c->win,
|
||||
WM_CLIENT_MACHINE, &value, &slen))
|
||||
return 0;
|
||||
lua_pushlstring(L, value, slen);
|
||||
p_delete(&value);
|
||||
lua_pushstring(L, c->machine);
|
||||
break;
|
||||
case A_TK_ICON_NAME:
|
||||
lua_pushstring(L, c->icon_name);
|
||||
|
|
2
client.h
2
client.h
|
@ -148,6 +148,8 @@ struct client_t
|
|||
/** Size hints */
|
||||
xcb_size_hints_t size_hints;
|
||||
bool size_hints_honor;
|
||||
/** Machine the client is running on. */
|
||||
char *machine;
|
||||
/** Window it is transient for */
|
||||
client_t *transient_for;
|
||||
};
|
||||
|
|
33
property.c
33
property.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* property.c - property handlers
|
||||
*
|
||||
* Copyright © 2008 Julien Danjou <julien@danjou.info>
|
||||
* Copyright © 2008-2009 Julien Danjou <julien@danjou.info>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -70,6 +70,35 @@ property_handle_wm_transient_for(void *data,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
property_update_wm_client_machine(client_t *c)
|
||||
{
|
||||
ssize_t slen;
|
||||
char *value;
|
||||
|
||||
if(!xutil_text_prop_get(globalconf.connection, c->win,
|
||||
WM_CLIENT_MACHINE, &value, &slen))
|
||||
return;
|
||||
|
||||
p_delete(&c->machine);
|
||||
c->machine = a_strdup(value);
|
||||
}
|
||||
|
||||
static int
|
||||
property_handle_wm_client_machine(void *data,
|
||||
xcb_connection_t *connection,
|
||||
uint8_t state,
|
||||
xcb_window_t window,
|
||||
xcb_atom_t name,
|
||||
xcb_get_property_reply_t *reply)
|
||||
{
|
||||
client_t *c = client_getbywin(window);
|
||||
|
||||
if(c)
|
||||
property_update_wm_client_machine(c);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Update leader hint of a client.
|
||||
* \param c The client.
|
||||
|
@ -498,6 +527,8 @@ void a_xcb_set_property_handlers(void)
|
|||
property_handle_wm_class, NULL);
|
||||
xcb_property_set_handler(&globalconf.prophs, WM_PROTOCOLS, UINT_MAX,
|
||||
property_handle_wm_protocols, NULL);
|
||||
xcb_property_set_handler(&globalconf.prophs, WM_CLIENT_MACHINE, UINT_MAX,
|
||||
property_handle_wm_client_machine, NULL);
|
||||
|
||||
/* EWMH stuff */
|
||||
xcb_property_set_handler(&globalconf.prophs, _NET_WM_NAME, UINT_MAX,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* property.h - property handlers header
|
||||
*
|
||||
* Copyright © 2008 Julien Danjou <julien@danjou.info>
|
||||
* Copyright © 2008-2009 Julien Danjou <julien@danjou.info>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -32,6 +32,7 @@ void property_update_wm_class(client_t *, xcb_get_property_reply_t *);
|
|||
void property_update_wm_name(client_t *);
|
||||
void property_update_wm_icon_name(client_t *);
|
||||
void property_update_wm_protocols(client_t *);
|
||||
void property_update_wm_client_machine(client_t *);
|
||||
void a_xcb_set_property_handlers(void);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue