/** Update the WM hints of a client. * \param c The client. * \param cookie Cookie returned by property_get_wm_hints. */ void property_update_wm_hints(client_t *c, xcb_get_property_cookie_t cookie) { xcb_icccm_wm_hints_t wmh; if(!xcb_icccm_get_wm_hints_reply(globalconf.connection, cookie, &wmh, NULL)) return; luaA_object_push(globalconf.L, c); client_set_urgent(globalconf.L, -1, xcb_icccm_wm_hints_get_urgency(&wmh)); if(wmh.flags & XCB_ICCCM_WM_HINT_INPUT) c->nofocus = !wmh.input; if(wmh.flags & XCB_ICCCM_WM_HINT_WINDOW_GROUP) client_set_group_window(globalconf.L, -1, wmh.window_group); if(!c->have_ewmh_icon) { if(wmh.flags & XCB_ICCCM_WM_HINT_ICON_PIXMAP) { if(wmh.flags & XCB_ICCCM_WM_HINT_ICON_MASK) client_set_icon_from_pixmaps(c, wmh.icon_pixmap, wmh.icon_mask); else client_set_icon_from_pixmaps(c, wmh.icon_pixmap, XCB_NONE); } else client_set_icon(c, NULL); } lua_pop(globalconf.L, 1); }
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); }
void property_update_net_wm_icon(client_t *c, xcb_get_property_cookie_t cookie) { cairo_surface_t *surface = ewmh_window_icon_get_reply(cookie); if(!surface) return; client_set_icon(c, surface); cairo_surface_destroy(surface); }