utf8_title_cookie, title_cookie,
class_cookie, leader_cookie, transient_cookie;
- wm_type_cookie = xcb_get_any_property_unchecked(conn, false, window, atoms[_NET_WM_WINDOW_TYPE], UINT32_MAX);
- strut_cookie = xcb_get_any_property_unchecked(conn, false, window, atoms[_NET_WM_STRUT_PARTIAL], UINT32_MAX);
- state_cookie = xcb_get_any_property_unchecked(conn, false, window, atoms[_NET_WM_STATE], UINT32_MAX);
- utf8_title_cookie = xcb_get_any_property_unchecked(conn, false, window, atoms[_NET_WM_NAME], 128);
- leader_cookie = xcb_get_any_property_unchecked(conn, false, window, atoms[WM_CLIENT_LEADER], UINT32_MAX);
- transient_cookie = xcb_get_any_property_unchecked(conn, false, window, WM_TRANSIENT_FOR, UINT32_MAX);
- title_cookie = xcb_get_any_property_unchecked(conn, false, window, WM_NAME, 128);
- class_cookie = xcb_get_any_property_unchecked(conn, false, window, WM_CLASS, 128);
- /* TODO: also get wm_normal_hints here. implement after we got rid of xcb-event */
geomc = xcb_get_geometry(conn, d);
goto out;
}
+#define GET_PROPERTY(atom, len) xcb_get_property_unchecked(conn, false, window, atom, XCB_GET_PROPERTY_TYPE_ANY, 0, len)
+
+ wm_type_cookie = GET_PROPERTY(A__NET_WM_WINDOW_TYPE, UINT32_MAX);
+ strut_cookie = GET_PROPERTY(A__NET_WM_STRUT_PARTIAL, UINT32_MAX);
+ state_cookie = GET_PROPERTY(A__NET_WM_STATE, UINT32_MAX);
+ utf8_title_cookie = GET_PROPERTY(A__NET_WM_NAME, 128);
+ leader_cookie = GET_PROPERTY(A_WM_CLIENT_LEADER, UINT32_MAX);
+ transient_cookie = GET_PROPERTY(A_WM_TRANSIENT_FOR, UINT32_MAX);
+ title_cookie = GET_PROPERTY(A_WM_NAME, 128);
+ class_cookie = GET_PROPERTY(A_WM_CLASS, 128);
+ /* TODO: also get wm_normal_hints here. implement after we got rid of xcb-event */
+
DLOG("reparenting!\n");
uint32_t mask = 0;
uint32_t values[1];
Con *search_at = croot;
xcb_get_property_reply_t *reply = xcb_get_property_reply(conn, wm_type_cookie, NULL);
- if (xcb_reply_contains_atom(reply, atoms[_NET_WM_WINDOW_TYPE_DOCK])) {
+ if (xcb_reply_contains_atom(reply, A__NET_WM_WINDOW_TYPE_DOCK)) {
LOG("This window is of type dock\n");
Output *output = get_output_containing(geom->x, geom->y);
if (output != NULL) {
/* set floating if necessary */
bool want_floating = false;
- if (xcb_reply_contains_atom(reply, atoms[_NET_WM_WINDOW_TYPE_DIALOG]) ||
- xcb_reply_contains_atom(reply, atoms[_NET_WM_WINDOW_TYPE_UTILITY]) ||
- xcb_reply_contains_atom(reply, atoms[_NET_WM_WINDOW_TYPE_TOOLBAR]) ||
- xcb_reply_contains_atom(reply, atoms[_NET_WM_WINDOW_TYPE_SPLASH])) {
+ if (xcb_reply_contains_atom(reply, A__NET_WM_WINDOW_TYPE_DIALOG) ||
+ xcb_reply_contains_atom(reply, A__NET_WM_WINDOW_TYPE_UTILITY) ||
+ xcb_reply_contains_atom(reply, A__NET_WM_WINDOW_TYPE_TOOLBAR) ||
+ xcb_reply_contains_atom(reply, A__NET_WM_WINDOW_TYPE_SPLASH)) {
LOG("This window is a dialog window, setting floating\n");
want_floating = true;
}
xcb_change_window_attributes(conn, window, mask, values);
reply = xcb_get_property_reply(conn, state_cookie, NULL);
- if (xcb_reply_contains_atom(reply, atoms[_NET_WM_STATE_FULLSCREEN]))
+ if (xcb_reply_contains_atom(reply, A__NET_WM_STATE_FULLSCREEN))
con_toggle_fullscreen(nc);
/* Put the client inside the save set. Upon termination (whether killed or