2 #define I3__FILE__ "randr.c"
4 * vim:ts=4:sw=4:expandtab
6 * i3 - an improved dynamic tiling window manager
7 * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
9 * For more information on RandR, please see the X.org RandR specification at
10 * http://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt
11 * (take your time to read it completely, it answers all questions).
17 #include <xcb/randr.h>
19 /* While a clean namespace is usually a pretty good thing, we really need
20 * to use shorter names than the whole xcb_randr_* default names. */
21 typedef xcb_randr_get_crtc_info_reply_t crtc_info;
22 typedef xcb_randr_get_screen_resources_current_reply_t resources_reply;
24 /* Pointer to the result of the query for primary output */
25 xcb_randr_get_output_primary_reply_t *primary;
27 /* Stores all outputs available in your current session. */
28 struct outputs_head outputs = TAILQ_HEAD_INITIALIZER(outputs);
30 static bool randr_disabled = false;
33 * Get a specific output by its internal X11 id. Used by randr_query_outputs
34 * to check if the output is new (only in the first scan) or if we are
38 static Output *get_output_by_id(xcb_randr_output_t id) {
40 TAILQ_FOREACH(output, &outputs, outputs)
48 * Returns the output with the given name if it is active (!) or NULL.
51 Output *get_output_by_name(const char *name) {
53 TAILQ_FOREACH(output, &outputs, outputs)
55 strcasecmp(output->name, name) == 0)
62 * Returns the first output which is active.
65 Output *get_first_output(void) {
68 TAILQ_FOREACH(output, &outputs, outputs)
72 die("No usable outputs available.\n");
76 * Returns the active (!) output which contains the coordinates x, y or NULL
77 * if there is no output which contains these coordinates.
80 Output *get_output_containing(int x, int y) {
82 TAILQ_FOREACH(output, &outputs, outputs) {
85 DLOG("comparing x=%d y=%d with x=%d and y=%d width %d height %d\n",
86 x, y, output->rect.x, output->rect.y, output->rect.width, output->rect.height);
87 if (x >= output->rect.x && x < (output->rect.x + output->rect.width) &&
88 y >= output->rect.y && y < (output->rect.y + output->rect.height))
96 * Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps.
98 * For example if get_output_next(D_DOWN, x, FARTHEST_OUTPUT) = NULL, then
99 * get_output_next_wrap(D_DOWN, x) will return the topmost output.
101 * This function always returns a output: if no active outputs can be found,
102 * current itself is returned.
105 Output *get_output_next_wrap(direction_t direction, Output *current) {
106 Output *best = get_output_next(direction, current, CLOSEST_OUTPUT);
107 /* If no output can be found, wrap */
109 direction_t opposite;
110 if (direction == D_RIGHT)
112 else if (direction == D_LEFT)
114 else if (direction == D_DOWN)
118 best = get_output_next(opposite, current, FARTHEST_OUTPUT);
122 DLOG("current = %s, best = %s\n", current->name, best->name);
127 * Gets the output which is the next one in the given direction.
129 * If close_far == CLOSEST_OUTPUT, then the output next to the current one will
130 * selected. If close_far == FARTHEST_OUTPUT, the output which is the last one
131 * in the given direction will be selected.
133 * NULL will be returned when no active outputs are present in the direction
134 * specified (note that “current” counts as such an output).
137 Output *get_output_next(direction_t direction, Output *current, output_close_far_t close_far) {
138 Rect *cur = &(current->rect),
142 TAILQ_FOREACH(output, &outputs, outputs) {
146 other = &(output->rect);
148 if ((direction == D_RIGHT && other->x > cur->x) ||
149 (direction == D_LEFT && other->x < cur->x)) {
150 /* Skip the output when it doesn’t overlap the other one’s y
151 * coordinate at all. */
152 if ((other->y + other->height) <= cur->y ||
153 (cur->y + cur->height) <= other->y)
155 } else if ((direction == D_DOWN && other->y > cur->y) ||
156 (direction == D_UP && other->y < cur->y)) {
157 /* Skip the output when it doesn’t overlap the other one’s x
158 * coordinate at all. */
159 if ((other->x + other->width) <= cur->x ||
160 (cur->x + cur->width) <= other->x)
165 /* No candidate yet? Start with this one. */
171 if (close_far == CLOSEST_OUTPUT) {
172 /* Is this output better (closer to the current output) than our
173 * current best bet? */
174 if ((direction == D_RIGHT && other->x < best->rect.x) ||
175 (direction == D_LEFT && other->x > best->rect.x) ||
176 (direction == D_DOWN && other->y < best->rect.y) ||
177 (direction == D_UP && other->y > best->rect.y)) {
182 /* Is this output better (farther to the current output) than our
183 * current best bet? */
184 if ((direction == D_RIGHT && other->x > best->rect.x) ||
185 (direction == D_LEFT && other->x < best->rect.x) ||
186 (direction == D_DOWN && other->y > best->rect.y) ||
187 (direction == D_UP && other->y < best->rect.y)) {
194 DLOG("current = %s, best = %s\n", current->name, (best ? best->name : "NULL"));
199 * Disables RandR support by creating exactly one output with the size of the
203 void disable_randr(xcb_connection_t *conn) {
204 DLOG("RandR extension unusable, disabling.\n");
206 Output *s = scalloc(sizeof(Output));
211 s->rect.width = root_screen->width_in_pixels;
212 s->rect.height = root_screen->height_in_pixels;
215 init_ws_for_output(s, output_get_content(s->con));
217 TAILQ_INSERT_TAIL(&outputs, s, outputs);
219 randr_disabled = true;
223 * Initializes a CT_OUTPUT Con (searches existing ones from inplace restart
224 * before) to use for the given Output.
227 void output_init_con(Output *output) {
228 Con *con = NULL, *current;
231 DLOG("init_con for output %s\n", output->name);
233 /* Search for a Con with that name directly below the root node. There
234 * might be one from a restored layout. */
235 TAILQ_FOREACH(current, &(croot->nodes_head), nodes) {
236 if (strcmp(current->name, output->name) != 0)
241 DLOG("Using existing con %p / %s\n", con, con->name);
246 con = con_new(croot, NULL);
248 con->name = sstrdup(output->name);
249 con->type = CT_OUTPUT;
250 con->layout = L_OUTPUT;
251 con_fix_percent(croot);
253 con->rect = output->rect;
257 sasprintf(&name, "[i3 con] output %s", con->name);
258 x_set_name(con, name);
262 DLOG("Not adding workspace, this was a reused con\n");
266 DLOG("Changing layout, adding top/bottom dockarea\n");
267 Con *topdock = con_new(NULL, NULL);
268 topdock->type = CT_DOCKAREA;
269 topdock->layout = L_DOCKAREA;
270 /* this container swallows dock clients */
271 Match *match = scalloc(sizeof(Match));
273 match->dock = M_DOCK_TOP;
274 match->insert_where = M_BELOW;
275 TAILQ_INSERT_TAIL(&(topdock->swallow_head), match, matches);
278 topdock->name = sstrdup("topdock");
280 sasprintf(&name, "[i3 con] top dockarea %s", con->name);
281 x_set_name(topdock, name);
284 con_attach(topdock, con, false);
286 /* content container */
288 DLOG("adding main content container\n");
289 Con *content = con_new(NULL, NULL);
290 content->type = CT_CON;
291 content->layout = L_SPLITH;
293 content->name = sstrdup("content");
295 sasprintf(&name, "[i3 con] content %s", con->name);
296 x_set_name(content, name);
298 con_attach(content, con, false);
300 /* bottom dock container */
301 Con *bottomdock = con_new(NULL, NULL);
302 bottomdock->type = CT_DOCKAREA;
303 bottomdock->layout = L_DOCKAREA;
304 /* this container swallows dock clients */
305 match = scalloc(sizeof(Match));
307 match->dock = M_DOCK_BOTTOM;
308 match->insert_where = M_BELOW;
309 TAILQ_INSERT_TAIL(&(bottomdock->swallow_head), match, matches);
311 FREE(bottomdock->name);
312 bottomdock->name = sstrdup("bottomdock");
314 sasprintf(&name, "[i3 con] bottom dockarea %s", con->name);
315 x_set_name(bottomdock, name);
318 con_attach(bottomdock, con, false);
322 * Initializes at least one workspace for this output, trying the following
323 * steps until there is at least one workspace:
325 * • Move existing workspaces, which are assigned to be on the given output, to
327 * • Create the first assigned workspace for this output.
328 * • Create the first unused workspace.
331 void init_ws_for_output(Output *output, Con *content) {
332 /* go through all assignments and move the existing workspaces to this output */
333 struct Workspace_Assignment *assignment;
334 TAILQ_FOREACH(assignment, &ws_assignments, ws_assignments) {
335 if (strcmp(assignment->output, output->name) != 0)
338 /* check if this workspace actually exists */
339 Con *workspace = NULL, *out;
340 TAILQ_FOREACH(out, &(croot->nodes_head), nodes)
341 GREP_FIRST(workspace, output_get_content(out),
342 !strcasecmp(child->name, assignment->name));
343 if (workspace == NULL)
346 /* check that this workspace is not already attached (that means the
347 * user configured this assignment twice) */
348 Con *workspace_out = con_get_output(workspace);
349 if (workspace_out == output->con) {
350 LOG("Workspace \"%s\" assigned to output \"%s\", but it is already "
351 "there. Do you have two assignment directives for the same "
352 "workspace in your configuration file?\n",
353 workspace->name, output->name);
357 /* if so, move it over */
358 LOG("Moving workspace \"%s\" from output \"%s\" to \"%s\" due to assignment\n",
359 workspace->name, workspace_out->name, output->name);
361 /* if the workspace is currently visible on that output, we need to
362 * switch to a different workspace - otherwise the output would end up
363 * with no active workspace */
364 bool visible = workspace_is_visible(workspace);
365 Con *previous = NULL;
366 if (visible && (previous = TAILQ_NEXT(workspace, focused))) {
367 LOG("Switching to previously used workspace \"%s\" on output \"%s\"\n",
368 previous->name, workspace_out->name);
369 workspace_show(previous);
372 /* Render the output on which the workspace was to get correct Rects.
373 * Then, we need to work with the "content" container, since we cannot
374 * be sure that the workspace itself was rendered at all (in case it’s
375 * invisible, it won’t be rendered). */
376 render_con(workspace_out, false);
377 Con *ws_out_content = output_get_content(workspace_out);
380 TAILQ_FOREACH(floating_con, &(workspace->floating_head), floating_windows)
381 /* NB: We use output->con here because content is not yet rendered,
382 * so it has a rect of {0, 0, 0, 0}. */
383 floating_fix_coordinates(floating_con, &(ws_out_content->rect), &(output->con->rect));
385 con_detach(workspace);
386 con_attach(workspace, content, false);
388 /* In case the workspace we just moved was visible but there was no
389 * other workspace to switch to, we need to initialize the source
391 if (visible && previous == NULL) {
392 LOG("There is no workspace left on \"%s\", re-initializing\n",
393 workspace_out->name);
394 init_ws_for_output(get_output_by_name(workspace_out->name),
395 output_get_content(workspace_out));
396 DLOG("Done re-initializing, continuing with \"%s\"\n", output->name);
400 /* if a workspace exists, we are done now */
401 if (!TAILQ_EMPTY(&(content->nodes_head))) {
402 /* ensure that one of the workspaces is actually visible (in fullscreen
403 * mode), if they were invisible before, this might not be the case. */
405 GREP_FIRST(visible, content, child->fullscreen_mode == CF_OUTPUT);
407 visible = TAILQ_FIRST(&(content->nodes_head));
409 workspace_show(visible);
414 /* otherwise, we create the first assigned ws for this output */
415 TAILQ_FOREACH(assignment, &ws_assignments, ws_assignments) {
416 if (strcmp(assignment->output, output->name) != 0)
419 LOG("Initializing first assigned workspace \"%s\" for output \"%s\"\n",
420 assignment->name, assignment->output);
422 workspace_show_by_name(assignment->name);
426 /* if there is still no workspace, we create the first free workspace */
427 DLOG("Now adding a workspace\n");
428 Con *ws = create_workspace_on_output(output, content);
430 /* TODO: Set focus in main.c */
435 * This function needs to be called when changing the mode of an output when
436 * it already has some workspaces (or a bar window) assigned.
438 * It reconfigures the bar window for the new mode, copies the new rect into
439 * each workspace on this output and forces all windows on the affected
440 * workspaces to be reconfigured.
442 * It is necessary to call render_layout() afterwards.
445 static void output_change_mode(xcb_connection_t *conn, Output *output) {
446 DLOG("Output mode changed, updating rect\n");
447 assert(output->con != NULL);
448 output->con->rect = output->rect;
450 Con *content, *workspace, *child;
452 /* Point content to the container of the workspaces */
453 content = output_get_content(output->con);
455 /* Fix the position of all floating windows on this output.
456 * The 'rect' of each workspace will be updated in src/render.c. */
457 TAILQ_FOREACH(workspace, &(content->nodes_head), nodes) {
458 TAILQ_FOREACH(child, &(workspace->floating_head), floating_windows) {
459 floating_fix_coordinates(child, &(workspace->rect), &(output->con->rect));
463 /* If default_orientation is NO_ORIENTATION, we change the orientation of
464 * the workspaces and their childs depending on output resolution. This is
465 * only done for workspaces with maximum one child. */
466 if (config.default_orientation == NO_ORIENTATION) {
467 TAILQ_FOREACH(workspace, &(content->nodes_head), nodes) {
468 /* Workspaces with more than one child are left untouched because
469 * we do not want to change an existing layout. */
470 if (con_num_children(workspace) > 1)
473 workspace->layout = (output->rect.height > output->rect.width) ? L_SPLITV : L_SPLITH;
474 DLOG("Setting workspace [%d,%s]'s layout to %d.\n", workspace->num, workspace->name, workspace->layout);
475 if ((child = TAILQ_FIRST(&(workspace->nodes_head)))) {
476 if (child->layout == L_SPLITV || child->layout == L_SPLITH)
477 child->layout = workspace->layout;
478 DLOG("Setting child [%d,%s]'s layout to %d.\n", child->num, child->name, child->layout);
485 * Gets called by randr_query_outputs() for each output. The function adds new
486 * outputs to the list of outputs, checks if the mode of existing outputs has
487 * been changed or if an existing output has been disabled. It will then change
488 * either the "changed" or the "to_be_deleted" flag of the output, if
492 static void handle_output(xcb_connection_t *conn, xcb_randr_output_t id,
493 xcb_randr_get_output_info_reply_t *output,
494 xcb_timestamp_t cts, resources_reply *res) {
495 /* each CRT controller has a position in which we are interested in */
498 Output *new = get_output_by_id(id);
499 bool existing = (new != NULL);
501 new = scalloc(sizeof(Output));
503 new->primary = (primary && primary->output == id);
505 sasprintf(&new->name, "%.*s",
506 xcb_randr_get_output_info_name_length(output),
507 xcb_randr_get_output_info_name(output));
509 DLOG("found output with name %s\n", new->name);
511 /* Even if no CRTC is used at the moment, we store the output so that
512 * we do not need to change the list ever again (we only update the
514 if (output->crtc == XCB_NONE) {
517 TAILQ_INSERT_HEAD(&outputs, new, outputs);
518 else TAILQ_INSERT_TAIL(&outputs, new, outputs);
519 } else if (new->active)
520 new->to_be_disabled = true;
524 xcb_randr_get_crtc_info_cookie_t icookie;
525 icookie = xcb_randr_get_crtc_info(conn, output->crtc, cts);
526 if ((crtc = xcb_randr_get_crtc_info_reply(conn, icookie, NULL)) == NULL) {
527 DLOG("Skipping output %s: could not get CRTC (%p)\n",
533 bool updated = update_if_necessary(&(new->rect.x), crtc->x) |
534 update_if_necessary(&(new->rect.y), crtc->y) |
535 update_if_necessary(&(new->rect.width), crtc->width) |
536 update_if_necessary(&(new->rect.height), crtc->height);
538 new->active = (new->rect.width != 0 && new->rect.height != 0);
540 DLOG("width/height 0/0, disabling output\n");
544 DLOG("mode: %dx%d+%d+%d\n", new->rect.width, new->rect.height,
545 new->rect.x, new->rect.y);
547 /* If we don’t need to change an existing output or if the output
548 * does not exist in the first place, the case is simple: we either
549 * need to insert the new output or we are done. */
550 if (!updated || !existing) {
553 TAILQ_INSERT_HEAD(&outputs, new, outputs);
554 else TAILQ_INSERT_TAIL(&outputs, new, outputs);
563 * (Re-)queries the outputs via RandR and stores them in the list of outputs.
566 void randr_query_outputs(void) {
567 Output *output, *other, *first;
568 xcb_randr_get_output_primary_cookie_t pcookie;
569 xcb_randr_get_screen_resources_current_cookie_t rcookie;
570 resources_reply *res;
572 /* timestamp of the configuration so that we get consistent replies to all
573 * requests (if the configuration changes between our different calls) */
576 /* an output is VGA-1, LVDS-1, etc. (usually physical video outputs) */
577 xcb_randr_output_t *randr_outputs;
582 /* Get screen resources (primary output, crtcs, outputs, modes) */
583 rcookie = xcb_randr_get_screen_resources_current(conn, root);
584 pcookie = xcb_randr_get_output_primary(conn, root);
586 if ((primary = xcb_randr_get_output_primary_reply(conn, pcookie, NULL)) == NULL)
587 ELOG("Could not get RandR primary output\n");
588 else DLOG("primary output is %08x\n", primary->output);
589 if ((res = xcb_randr_get_screen_resources_current_reply(conn, rcookie, NULL)) == NULL) {
593 cts = res->config_timestamp;
595 int len = xcb_randr_get_screen_resources_current_outputs_length(res);
596 randr_outputs = xcb_randr_get_screen_resources_current_outputs(res);
598 /* Request information for each output */
599 xcb_randr_get_output_info_cookie_t ocookie[len];
600 for (int i = 0; i < len; i++)
601 ocookie[i] = xcb_randr_get_output_info(conn, randr_outputs[i], cts);
603 /* Loop through all outputs available for this X11 screen */
604 for (int i = 0; i < len; i++) {
605 xcb_randr_get_output_info_reply_t *output;
607 if ((output = xcb_randr_get_output_info_reply(conn, ocookie[i], NULL)) == NULL)
610 handle_output(conn, randr_outputs[i], output, cts, res);
614 /* Check for clones, disable the clones and reduce the mode to the
615 * lowest common mode */
616 TAILQ_FOREACH(output, &outputs, outputs) {
617 if (!output->active || output->to_be_disabled)
619 DLOG("output %p / %s, position (%d, %d), checking for clones\n",
620 output, output->name, output->rect.x, output->rect.y);
623 other != TAILQ_END(&outputs);
624 other = TAILQ_NEXT(other, outputs)) {
625 if (other == output || !other->active || other->to_be_disabled)
628 if (other->rect.x != output->rect.x ||
629 other->rect.y != output->rect.y)
632 DLOG("output %p has the same position, his mode = %d x %d\n",
633 other, other->rect.width, other->rect.height);
634 uint32_t width = min(other->rect.width, output->rect.width);
635 uint32_t height = min(other->rect.height, output->rect.height);
637 if (update_if_necessary(&(output->rect.width), width) |
638 update_if_necessary(&(output->rect.height), height))
639 output->changed = true;
641 update_if_necessary(&(other->rect.width), width);
642 update_if_necessary(&(other->rect.height), height);
644 DLOG("disabling output %p (%s)\n", other, other->name);
645 other->to_be_disabled = true;
647 DLOG("new output mode %d x %d, other mode %d x %d\n",
648 output->rect.width, output->rect.height,
649 other->rect.width, other->rect.height);
653 /* Ensure that all outputs which are active also have a con. This is
654 * necessary because in the next step, a clone might get disabled. Example:
655 * LVDS1 active, VGA1 gets activated as a clone of LVDS1 (has no con).
656 * LVDS1 gets disabled. */
657 TAILQ_FOREACH(output, &outputs, outputs) {
658 if (output->active && output->con == NULL) {
659 DLOG("Need to initialize a Con for output %s\n", output->name);
660 output_init_con(output);
661 output->changed = false;
665 /* Handle outputs which have a new mode or are disabled now (either
666 * because the user disabled them or because they are clones) */
667 TAILQ_FOREACH(output, &outputs, outputs) {
668 if (output->to_be_disabled) {
669 output->active = false;
670 DLOG("Output %s disabled, re-assigning workspaces/docks\n", output->name);
672 first = get_first_output();
674 /* TODO: refactor the following code into a nice function. maybe
675 * use an on_destroy callback which is implement differently for
676 * different container types (CT_CONTENT vs. CT_DOCKAREA)? */
677 Con *first_content = output_get_content(first->con);
679 if (output->con != NULL) {
680 /* We need to move the workspaces from the disappearing output to the first output */
681 /* 1: Get the con to focus next, if the disappearing ws is focused */
683 if (TAILQ_FIRST(&(croot->focus_head)) == output->con) {
684 DLOG("This output (%p) was focused! Getting next\n", output->con);
686 DLOG("next = %p\n", next);
689 /* 2: iterate through workspaces and re-assign them, fixing the coordinates
690 * of floating containers as we go */
692 Con *old_content = output_get_content(output->con);
693 while (!TAILQ_EMPTY(&(old_content->nodes_head))) {
694 current = TAILQ_FIRST(&(old_content->nodes_head));
695 if (current != next && TAILQ_EMPTY(&(current->focus_head))) {
696 /* the workspace is empty and not focused, get rid of it */
697 DLOG("Getting rid of current = %p / %s (empty, unfocused)\n", current, current->name);
698 tree_close(current, DONT_KILL_WINDOW, false, false);
701 DLOG("Detaching current = %p / %s\n", current, current->name);
703 DLOG("Re-attaching current = %p / %s\n", current, current->name);
704 con_attach(current, first_content, false);
705 DLOG("Fixing the coordinates of floating containers\n");
707 TAILQ_FOREACH(floating_con, &(current->floating_head), floating_windows)
708 floating_fix_coordinates(floating_con, &(output->con->rect), &(first->con->rect));
709 DLOG("Done, next\n");
711 DLOG("re-attached all workspaces\n");
714 DLOG("now focusing next = %p\n", next);
716 workspace_show(con_get_workspace(next));
719 /* 3: move the dock clients to the first output */
721 TAILQ_FOREACH(child, &(output->con->nodes_head), nodes) {
722 if (child->type != CT_DOCKAREA)
724 DLOG("Handling dock con %p\n", child);
726 while (!TAILQ_EMPTY(&(child->nodes_head))) {
727 dock = TAILQ_FIRST(&(child->nodes_head));
730 nc = con_for_window(first->con, dock->window, &match);
731 DLOG("Moving dock client %p to nc %p\n", dock, nc);
733 DLOG("Re-attaching\n");
734 con_attach(dock, nc, false);
739 DLOG("destroying disappearing con %p\n", output->con);
740 tree_close(output->con, DONT_KILL_WINDOW, true, false);
741 DLOG("Done. Should be fine now\n");
745 output->to_be_disabled = false;
746 output->changed = false;
749 if (output->changed) {
750 output_change_mode(conn, output);
751 output->changed = false;
755 if (TAILQ_EMPTY(&outputs)) {
756 ELOG("No outputs found via RandR, disabling\n");
760 /* Verifies that there is at least one active output as a side-effect. */
763 /* Just go through each active output and assign one workspace */
764 TAILQ_FOREACH(output, &outputs, outputs) {
767 Con *content = output_get_content(output->con);
768 if (!TAILQ_EMPTY(&(content->nodes_head)))
770 DLOG("Should add ws for output %s\n", output->name);
771 init_ws_for_output(output, content);
774 /* Focus the primary screen, if possible */
775 TAILQ_FOREACH(output, &outputs, outputs) {
776 if (!output->primary || !output->con)
779 DLOG("Focusing primary output %s\n", output->name);
780 con_focus(con_descend_focused(output->con));
783 /* render_layout flushes */
791 * We have just established a connection to the X server and need the initial
792 * XRandR information to setup workspaces for each screen.
795 void randr_init(int *event_base) {
796 const xcb_query_extension_reply_t *extreply;
798 extreply = xcb_get_extension_data(conn, &xcb_randr_id);
799 if (!extreply->present) {
802 } else randr_query_outputs();
804 if (event_base != NULL)
805 *event_base = extreply->first_event;
807 xcb_randr_select_input(conn, root,
808 XCB_RANDR_NOTIFY_MASK_SCREEN_CHANGE |
809 XCB_RANDR_NOTIFY_MASK_OUTPUT_CHANGE |
810 XCB_RANDR_NOTIFY_MASK_CRTC_CHANGE |
811 XCB_RANDR_NOTIFY_MASK_OUTPUT_PROPERTY);