2 #define I3__FILE__ "ewmh.c"
33 if (ws == focused_ws) {
34 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
60 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
78 msg_length += strlen(ws->
name) + 1;
82 char desktop_names[msg_length];
83 int current_position = 0;
92 for (
size_t i = 0; i < strlen(ws->
name) + 1; i++) {
93 desktop_names[current_position++] = ws->
name[i];
98 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
99 A__NET_DESKTOP_NAMES, A_UTF8_STRING, 8, msg_length, desktop_names);
108 int num_desktops = 0;
120 uint32_t viewports[num_desktops * 2];
122 int current_position = 0;
130 viewports[current_position++] = output->
rect.
x;
131 viewports[current_position++] = output->
rect.
y;
135 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
147 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root,
167 xcb_delete_property(
conn,
root, A__NET_WORKAREA);
177 XCB_PROP_MODE_REPLACE,
193 XCB_PROP_MODE_REPLACE,
195 A__NET_CLIENT_LIST_STACKING,
207 xcb_atom_t supported_atoms[] = {
208 #define xmacro(atom) A_##atom,
209 #include "atoms.xmacro"
218 xcb_window_t child_window = xcb_generate_id(
conn);
221 XCB_COPY_FROM_PARENT,
226 XCB_WINDOW_CLASS_INPUT_ONLY,
227 XCB_COPY_FROM_PARENT,
230 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE, child_window, A__NET_SUPPORTING_WM_CHECK,
XCB_ATOM_WINDOW, 32, 1, &child_window);
231 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE, child_window, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(
"i3"),
"i3");
232 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root, A__NET_SUPPORTING_WM_CHECK,
XCB_ATOM_WINDOW, 32, 1, &child_window);
235 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root, A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(
"i3"),
"i3");
238 xcb_change_property(
conn, XCB_PROP_MODE_REPLACE,
root, A__NET_SUPPORTED,
XCB_ATOM_ATOM, 32, 24, supported_atoms);
#define STARTS_WITH(string, needle)
void ewmh_update_client_list_stacking(xcb_window_t *stack, int num_windows)
Updates the _NET_CLIENT_LIST_STACKING hint.
void ewmh_update_number_of_desktops(void)
Updates _NET_NUMBER_OF_DESKTOPS which we interpret as the number of noninternal workspaces.
Con * con_get_workspace(Con *con)
Gets the workspace container this node is on.
void ewmh_update_desktop_names(void)
Updates _NET_DESKTOP_NAMES: "The names of all virtual desktops.
void ewmh_update_desktop_viewport(void)
Updates _NET_DESKTOP_VIEWPORT, which is an array of pairs of cardinals that define the top left corne...
void ewmh_update_client_list(xcb_window_t *list, int num_windows)
Updates the _NET_CLIENT_LIST hint.
static struct stack_entry stack[10]
void ewmh_update_workarea(void)
i3 currently does not support _NET_WORKAREA, because it does not correspond to i3’s concept of works...
void ewmh_update_current_desktop(void)
Updates _NET_CURRENT_DESKTOP with the current desktop number.
void ewmh_setup_hints(void)
Set up the EWMH hints on the root window.
A 'Con' represents everything from the X11 root window down to a single X11 window.
Con * output_get_content(Con *output)
Returns the output container below the given output container.
#define TAILQ_FOREACH(var, head, field)
void ewmh_update_active_window(xcb_window_t window)
Updates _NET_ACTIVE_WINDOW with the currently focused window.
#define XCB_ATOM_CARDINAL