/** 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); }
/** Update the WM hints of a client. * \param c The client. * \param reply (Optional) An existing reply. */ void property_update_wm_hints(client_t *c, xcb_get_property_reply_t *reply) { xcb_icccm_wm_hints_t wmh; if(reply) { if(!xcb_icccm_get_wm_hints_from_reply(&wmh, reply)) return; } else { if(!xcb_icccm_get_wm_hints_reply(globalconf.connection, xcb_icccm_get_wm_hints_unchecked(globalconf.connection, c->window), &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_STATE && wmh.initial_state == XCB_ICCCM_WM_STATE_WITHDRAWN) client_set_border_width(globalconf.L, -1, 0); 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); #ifdef LAB126 /* pop client */ lua_pop(globalconf.L, 1); #endif }
/** 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); lua_pop(globalconf.L, 1); }