2 #define I3__FILE__ "ewmh.c"
30 if (ws == focused_ws) {
31 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
48 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
65 int num_workspaces = 0, count = 0;
66 Rect last_rect = {0, 0, 0, 0};
77 if (last_rect.
width == 0 && last_rect.
height == 0 &&
79 memcpy(&last_rect, &(ws->
rect),
sizeof(
Rect));
85 DLOG(
"Got %d workspaces\n", num_workspaces);
86 uint8_t *workarea =
smalloc(
sizeof(
Rect) * num_workspaces);
90 DLOG(
"storing %d: %dx%d with %d x %d\n", count, ws->
rect.
x,
98 DLOG(
"re-using last_rect (%dx%d, %d, %d)\n",
99 last_rect.
x, last_rect.
y, last_rect.
width,
101 memcpy(workarea + (
sizeof(
Rect) * count++), &last_rect,
sizeof(
Rect));
104 memcpy(workarea + (
sizeof(
Rect) * count++), &(ws->
rect),
sizeof(
Rect));
105 memcpy(&last_rect, &(ws->
rect),
sizeof(
Rect));
108 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
110 num_workspaces * (
sizeof(
Rect) /
sizeof(uint32_t)),
123 XCB_PROP_MODE_REPLACE,
125 A__NET_CLIENT_LIST_STACKING,
137 xcb_atom_t supported_atoms[] = {
138 #define xmacro(atom) A_ ## atom,
139 #include "atoms.xmacro"
148 xcb_window_t child_window = xcb_generate_id(
conn);
151 XCB_COPY_FROM_PARENT,
156 XCB_WINDOW_CLASS_INPUT_ONLY,
157 XCB_COPY_FROM_PARENT,
160 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE, child_window, A__NET_SUPPORTING_WM_CHECK,
XCB_ATOM_WINDOW, 32, 1, &child_window);
161 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE, child_window, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(
"i3"),
"i3");
162 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root, A__NET_SUPPORTING_WM_CHECK,
XCB_ATOM_WINDOW, 32, 1, &child_window);
165 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(
"i3"),
"i3");
167 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root, A__NET_SUPPORTED,
XCB_ATOM_ATOM, 32, 16, supported_atoms);