28 if (ws == focused_ws) {
29 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
46 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
63 int num_workspaces = 0, count = 0;
64 Rect last_rect = {0, 0, 0, 0};
75 if (last_rect.
width == 0 && last_rect.
height == 0 &&
77 memcpy(&last_rect, &(ws->
rect),
sizeof(
Rect));
83 DLOG(
"Got %d workspaces\n", num_workspaces);
84 uint8_t *workarea =
smalloc(
sizeof(
Rect) * num_workspaces);
88 DLOG(
"storing %d: %dx%d with %d x %d\n", count, ws->
rect.
x,
96 DLOG(
"re-using last_rect (%dx%d, %d, %d)\n",
97 last_rect.
x, last_rect.
y, last_rect.
width,
99 memcpy(workarea + (
sizeof(
Rect) * count++), &last_rect,
sizeof(
Rect));
102 memcpy(workarea + (
sizeof(
Rect) * count++), &(ws->
rect),
sizeof(
Rect));
103 memcpy(&last_rect, &(ws->
rect),
sizeof(
Rect));
106 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
108 num_workspaces * (
sizeof(
Rect) /
sizeof(uint32_t)),
121 XCB_PROP_MODE_REPLACE,
123 A__NET_CLIENT_LIST_STACKING,
135 xcb_atom_t supported_atoms[] = {
136 #define xmacro(atom) A_ ## atom,
137 #include "atoms.xmacro"
146 xcb_window_t child_window = xcb_generate_id(
conn);
149 XCB_COPY_FROM_PARENT,
154 XCB_WINDOW_CLASS_INPUT_ONLY,
155 XCB_COPY_FROM_PARENT,
158 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE, child_window, A__NET_SUPPORTING_WM_CHECK,
XCB_ATOM_WINDOW, 32, 1, &child_window);
159 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE, child_window, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(
"i3"),
"i3");
160 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root, A__NET_SUPPORTING_WM_CHECK,
XCB_ATOM_WINDOW, 32, 1, &child_window);
163 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(
"i3"),
"i3");
165 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root, A__NET_SUPPORTED,
XCB_ATOM_ATOM, 32, 16, supported_atoms);