void property_update_net_wm_icon(client_t *c, xcb_get_property_reply_t *reply) { luaA_object_push(globalconf.L, c); if(reply) { if(ewmh_window_icon_from_reply(reply)) client_set_icon(globalconf.L, -2, -1); } else if(ewmh_window_icon_get_reply(ewmh_window_icon_get_unchecked(c->window))) client_set_icon(globalconf.L, -2, -1); /* remove client */ lua_pop(globalconf.L, 1); }
static int property_handle_net_wm_icon(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) { image_t *icon; image_unref(&c->icon); icon = ewmh_window_icon_from_reply(reply); c->icon = icon ? image_ref(&icon) : NULL; /* execute hook */ hooks_property(c, "icon"); } return 0; }