xmacro(WM_STATE)
xmacro(WM_CLIENT_LEADER)
xmacro(WM_TAKE_FOCUS)
-xmacro(WM_HINTS)
-xmacro(WM_NORMAL_HINTS)
-xmacro(WM_TRANSIENT_FOR)
-xmacro(ATOM)
-xmacro(WINDOW)
-xmacro(WM_NAME)
-xmacro(WM_CLASS)
-xmacro(STRING)
-xmacro(CARDINAL)
xmacro(I3_SOCKET_PATH)
xmacro(I3_CONFIG_PATH)
#define xcb_icccm_wm_hints_get_urgency xcb_wm_hints_get_urgency
#define xcb_icccm_get_wm_transient_for_from_reply xcb_get_wm_transient_for_from_reply
+#define XCB_ATOM_CARDINAL CARDINAL
+#define XCB_ATOM_WINDOW WINDOW
+#define XCB_ATOM_WM_TRANSIENT_FOR WM_TRANSIENT_FOR
+#define XCB_ATOM_WM_NAME WM_NAME
+#define XCB_ATOM_WM_CLASS WM_CLASS
+#define XCB_ATOM_WM_HINTS WM_HINTS
+#define XCB_ATOM_ATOM ATOM
+#define XCB_ATOM_WM_NORMAL_HINTS WM_NORMAL_HINTS
+#define XCB_ATOM_STRING STRING
+
#endif
values[num++] = A__NET_WM_STATE_FULLSCREEN;
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, con->window->id,
- A__NET_WM_STATE, A_ATOM, 32, num, values);
+ A__NET_WM_STATE, XCB_ATOM_ATOM, 32, num, values);
}
/*
TAILQ_FOREACH(ws, &(output_get_content(output)->nodes_head), nodes) {
if (ws == focused_ws) {
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
- A__NET_CURRENT_DESKTOP, A_CARDINAL, 32, 1, &idx);
+ A__NET_CURRENT_DESKTOP, XCB_ATOM_CARDINAL, 32, 1, &idx);
return;
}
++idx;
*/
void ewmh_update_active_window(xcb_window_t window) {
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
- A__NET_ACTIVE_WINDOW, A_WINDOW, 32, 1, &window);
+ A__NET_ACTIVE_WINDOW, XCB_ATOM_WINDOW, 32, 1, &window);
}
/*
}
}
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
- A__NET_WORKAREA, A_CARDINAL, 32,
+ A__NET_WORKAREA, XCB_ATOM_CARDINAL, 32,
num_workspaces * (sizeof(Rect) / sizeof(uint32_t)),
workarea);
free(workarea);
XCB_PROP_MODE_REPLACE,
root,
A__NET_CLIENT_LIST_STACKING,
- A_WINDOW,
+ XCB_ATOM_WINDOW,
32,
num_windows,
stack);
if (prop == NULL) {
prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn,
- false, window, A_WM_TRANSIENT_FOR, A_WINDOW, 0, 32), NULL);
+ false, window, XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, 0, 32), NULL);
if (prop == NULL)
return false;
}
if (prop == NULL) {
prop = xcb_get_property_reply(conn, xcb_get_property_unchecked(conn,
- false, window, A_WM_CLIENT_LEADER, A_WINDOW, 0, 32), NULL);
+ false, window, A_WM_CLIENT_LEADER, XCB_ATOM_WINDOW, 0, 32), NULL);
if (prop == NULL)
return false;
}
*/
void property_handlers_init() {
property_handlers[0].atom = A__NET_WM_NAME;
- property_handlers[1].atom = A_WM_HINTS;
- property_handlers[2].atom = A_WM_NAME;
- property_handlers[3].atom = A_WM_NORMAL_HINTS;
+ property_handlers[1].atom = XCB_ATOM_WM_HINTS;
+ property_handlers[2].atom = XCB_ATOM_WM_NAME;
+ property_handlers[3].atom = XCB_ATOM_WM_NORMAL_HINTS;
property_handlers[4].atom = A_WM_CLIENT_LEADER;
- property_handlers[5].atom = A_WM_TRANSIENT_FOR;
+ property_handlers[5].atom = XCB_ATOM_WM_TRANSIENT_FOR;
}
static void property_notify(uint8_t state, xcb_window_t window, xcb_atom_t atom) {
#include "atoms.xmacro"
#undef xmacro
};
- xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTED, A_ATOM, 32, 16, supported_atoms);
+ xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTED, XCB_ATOM_ATOM, 32, 16, supported_atoms);
/* Set up the window manager’s name */
- xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTING_WM_CHECK, A_WINDOW, 32, 1, &root);
+ xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_SUPPORTING_WM_CHECK, XCB_ATOM_WINDOW, 32, 1, &root);
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen("i3"), "i3");
keysyms = xcb_key_symbols_alloc(conn);
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);
+ transient_cookie = GET_PROPERTY(XCB_ATOM_WM_TRANSIENT_FOR, UINT32_MAX);
+ title_cookie = GET_PROPERTY(XCB_ATOM_WM_NAME, 128);
+ class_cookie = GET_PROPERTY(XCB_ATOM_WM_CLASS, 128);
/* TODO: also get wm_normal_hints here. implement after we got rid of xcb-event */
DLOG("reparenting!\n");
DLOG("pushing name %s for con %p\n", state->name, con);
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, con->frame,
- A_WM_NAME, A_STRING, 8, strlen(state->name), state->name);
+ XCB_ATOM_WM_NAME, XCB_ATOM_STRING, 8, strlen(state->name), state->name);
FREE(state->name);
}