1 /* Copyright (c) 2012, Bastien Dejean
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * 1. Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation
11 * and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 #include "subscribe.h"
39 void schedule_window(xcb_window_t win)
42 uint8_t override_redirect = 0;
43 xcb_get_window_attributes_reply_t *wa = xcb_get_window_attributes_reply(dpy, xcb_get_window_attributes(dpy, win), NULL);
46 override_redirect = wa->override_redirect;
50 if (override_redirect || locate_window(win, &loc))
53 /* ignore pending windows */
54 for (pending_rule_t *pr = pending_rule_head; pr != NULL; pr = pr->next)
58 rule_consequence_t *csq = make_rule_conquence();
59 apply_rules(win, csq);
60 if (!schedule_rules(win, csq)) {
61 manage_window(win, csq, -1);
66 void manage_window(xcb_window_t win, rule_consequence_t *csq, int fd)
69 desktop_t *d = mon->desk;
70 node_t *f = mon->desk->focus;
72 parse_rule_consequence(fd, csq);
81 if (csq->node_desc[0] != '\0') {
82 coordinates_t ref = {m, d, f};
83 coordinates_t trg = {NULL, NULL, NULL};
84 if (node_from_desc(csq->node_desc, &ref, &trg)) {
89 } else if (csq->desktop_desc[0] != '\0') {
90 coordinates_t ref = {m, d, NULL};
91 coordinates_t trg = {NULL, NULL, NULL};
92 if (desktop_from_desc(csq->desktop_desc, &ref, &trg)) {
95 f = trg.desktop->focus;
97 } else if (csq->monitor_desc[0] != '\0') {
98 coordinates_t ref = {m, NULL, NULL};
99 coordinates_t trg = {NULL, NULL, NULL};
100 if (monitor_from_desc(csq->monitor_desc, &ref, &trg)) {
102 d = trg.monitor->desk;
103 f = trg.monitor->desk->focus;
110 f = mon->desk->focus;
113 if (csq->split_dir[0] != '\0' && f != NULL) {
115 if (parse_direction(csq->split_dir, &dir)) {
116 f->split_mode = MODE_MANUAL;
121 if (csq->split_ratio != 0 && f != NULL) {
122 f->split_ratio = csq->split_ratio;
125 client_t *c = make_client(win, csq->border ? d->border_width : 0);
126 update_floating_rectangle(c);
127 if (c->floating_rectangle.x == 0 && c->floating_rectangle.y == 0) {
130 c->min_width = csq->min_width;
131 c->max_width = csq->max_width;
132 c->min_height = csq->min_height;
133 c->max_height = csq->max_height;
134 monitor_t *mm = monitor_from_client(c);
135 embrace_client(mm, c);
136 translate_client(mm, m, c);
142 snprintf(c->class_name, sizeof(c->class_name), "%s", csq->class_name);
143 snprintf(c->instance_name, sizeof(c->instance_name), "%s", csq->instance_name);
145 node_t *n = make_node();
148 put_status(SBSC_MASK_WINDOW_MANAGE, "window_manage %s %s 0x%X 0x%X\n", m->name, d->name, win, f!=NULL?f->client->window:0);
149 insert_node(m, d, n, f);
151 if (f != NULL && f->client != NULL && csq->state != NULL && *(csq->state) == STATE_FLOATING) {
152 c->layer = f->client->layer;
155 if (csq->layer != NULL) {
156 c->layer = *(csq->layer);
159 set_state(m, d, n, csq->state != NULL ? *(csq->state) : c->state);
160 set_locked(m, d, n, csq->locked);
161 set_sticky(m, d, n, csq->sticky);
162 set_private(m, d, n, csq->private);
166 bool give_focus = (csq->focus && (d == mon->desk || csq->follow));
170 } else if (csq->focus) {
171 activate_node(m, d, n);
176 uint32_t values[] = {CLIENT_EVENT_MASK | (focus_follows_pointer ? XCB_EVENT_MASK_ENTER_WINDOW : 0)};
177 xcb_change_window_attributes(dpy, c->window, XCB_CW_EVENT_MASK, values);
181 window_show(n->client->window);
183 window_hide(n->client->window);
186 /* the same function is already called in `focus_node` but has no effects on unmapped windows */
188 xcb_set_input_focus(dpy, XCB_INPUT_FOCUS_POINTER_ROOT, win, XCB_CURRENT_TIME);
192 ewmh_set_wm_desktop(n, d);
193 ewmh_update_client_list();
198 void unmanage_window(xcb_window_t win)
201 if (locate_window(win, &loc)) {
202 put_status(SBSC_MASK_WINDOW_UNMANAGE, "window_unmanage %s %s 0x%X\n", loc.monitor, loc.desktop, win);
203 remove_node(loc.monitor, loc.desktop, loc.node);
204 if (frozen_pointer->window == win)
205 frozen_pointer->action = ACTION_NONE;
206 arrange(loc.monitor, loc.desktop);
208 for (pending_rule_t *pr = pending_rule_head; pr != NULL; pr = pr->next) {
209 if (pr->win == win) {
210 remove_pending_rule(pr);
217 void window_draw_border(node_t *n, bool focused_window, bool focused_monitor)
219 if (n == NULL || n->client->border_width < 1) {
223 xcb_window_t win = n->client->window;
224 uint32_t border_color_pxl = get_border_color(n->client, focused_window, focused_monitor);
226 if (n->split_mode == MODE_AUTOMATIC) {
227 xcb_change_window_attributes(dpy, win, XCB_CW_BORDER_PIXEL, &border_color_pxl);
229 unsigned int border_width = n->client->border_width;
230 uint32_t presel_border_color_pxl;
231 get_color(presel_border_color, win, &presel_border_color_pxl);
233 xcb_rectangle_t actual_rectangle = get_rectangle(NULL, n->client);
235 uint16_t width = actual_rectangle.width;
236 uint16_t height = actual_rectangle.height;
238 uint16_t full_width = width + 2 * border_width;
239 uint16_t full_height = height + 2 * border_width;
241 xcb_rectangle_t border_rectangles[] =
243 { width, 0, 2 * border_width, height + 2 * border_width },
244 { 0, height, width + 2 * border_width, 2 * border_width }
247 xcb_rectangle_t *presel_rectangles;
249 uint8_t win_depth = root_depth;
250 xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply(dpy, xcb_get_geometry(dpy, win), NULL);
252 win_depth = geo->depth;
255 xcb_pixmap_t pixmap = xcb_generate_id(dpy);
256 xcb_create_pixmap(dpy, win_depth, pixmap, win, full_width, full_height);
258 xcb_gcontext_t gc = xcb_generate_id(dpy);
259 xcb_create_gc(dpy, gc, pixmap, 0, NULL);
261 xcb_change_gc(dpy, gc, XCB_GC_FOREGROUND, &border_color_pxl);
262 xcb_poly_fill_rectangle(dpy, pixmap, gc, LENGTH(border_rectangles), border_rectangles);
264 uint16_t fence = (int16_t) (n->split_ratio * ((n->split_dir == DIR_UP || n->split_dir == DIR_DOWN) ? height : width));
265 presel_rectangles = malloc(2 * sizeof(xcb_rectangle_t));
266 switch (n->split_dir) {
268 presel_rectangles[0] = (xcb_rectangle_t) {width, 0, 2 * border_width, fence};
269 presel_rectangles[1] = (xcb_rectangle_t) {0, height + border_width, full_width, border_width};
272 presel_rectangles[0] = (xcb_rectangle_t) {width, fence + 1, 2 * border_width, height + border_width - (fence + 1)};
273 presel_rectangles[1] = (xcb_rectangle_t) {0, height, full_width, border_width};
276 presel_rectangles[0] = (xcb_rectangle_t) {0, height, fence, 2 * border_width};
277 presel_rectangles[1] = (xcb_rectangle_t) {width + border_width, 0, border_width, full_height};
280 presel_rectangles[0] = (xcb_rectangle_t) {fence + 1, height, width + border_width - (fence + 1), 2 * border_width};
281 presel_rectangles[1] = (xcb_rectangle_t) {width, 0, border_width, full_height};
284 xcb_change_gc(dpy, gc, XCB_GC_FOREGROUND, &presel_border_color_pxl);
285 xcb_poly_fill_rectangle(dpy, pixmap, gc, 2, presel_rectangles);
286 xcb_change_window_attributes(dpy, win, XCB_CW_BORDER_PIXMAP, &pixmap);
287 free(presel_rectangles);
288 xcb_free_gc(dpy, gc);
289 xcb_free_pixmap(dpy, pixmap);
293 pointer_state_t *make_pointer_state(void)
295 pointer_state_t *p = malloc(sizeof(pointer_state_t));
298 p->node = p->vertical_fence = p->horizontal_fence = NULL;
300 p->window = XCB_NONE;
301 p->action = ACTION_NONE;
305 /* Returns true if a contains b */
306 bool contains(xcb_rectangle_t a, xcb_rectangle_t b)
308 return (a.x <= b.x && (a.x + a.width) >= (b.x + b.width) &&
309 a.y <= b.y && (a.y + a.height) >= (b.y + b.height));
312 xcb_rectangle_t get_rectangle(monitor_t *m, client_t *c)
316 return c->tiled_rectangle;
318 case STATE_PSEUDO_TILED:
320 return c->floating_rectangle;
322 case STATE_FULLSCREEN:
328 void get_side_handle(client_t *c, direction_t dir, xcb_point_t *pt)
330 xcb_rectangle_t rect = get_rectangle(NULL, c);
334 pt->x = rect.x + rect.width;
335 pt->y = rect.y + (rect.height / 2);
338 pt->x = rect.x + (rect.width / 2);
339 pt->y = rect.y + rect.height;
343 pt->y = rect.y + (rect.height / 2);
346 pt->x = rect.x + (rect.width / 2);
352 void adopt_orphans(void)
354 xcb_query_tree_reply_t *qtr = xcb_query_tree_reply(dpy, xcb_query_tree(dpy, root), NULL);
358 int len = xcb_query_tree_children_length(qtr);
359 xcb_window_t *wins = xcb_query_tree_children(qtr);
360 for (int i = 0; i < len; i++) {
362 xcb_window_t win = wins[i];
363 if (xcb_ewmh_get_wm_desktop_reply(ewmh, xcb_ewmh_get_wm_desktop(ewmh, win), &idx, NULL) == 1)
364 schedule_window(win);
370 void window_close(node_t *n)
372 if (n == NULL || n->client->locked)
375 send_client_message(n->client->window, ewmh->WM_PROTOCOLS, WM_DELETE_WINDOW);
378 void window_kill(monitor_t *m, desktop_t *d, node_t *n)
383 xcb_window_t win = n->client->window;
385 xcb_kill_client(dpy, win);
386 remove_node(m, d, n);
389 void set_layer(monitor_t *m, desktop_t *d, node_t *n, stack_layer_t l)
391 if (n == NULL || n->client->layer == l) {
395 client_t *c = n->client;
399 put_status(SBSC_MASK_WINDOW_LAYER, "window_layer %s %s 0x%X %s\n", m->name, d->name, c->window, LAYERSTR(l));
402 neutralize_obscuring_windows(m, d, n);
405 stack(n, (d->focus == n));
408 void set_state(monitor_t *m, desktop_t *d, node_t *n, client_state_t s)
410 if (n == NULL || n->client->state == s) {
414 client_t *c = n->client;
416 c->last_state = c->state;
419 switch (c->last_state) {
421 case STATE_PSEUDO_TILED:
424 set_floating(m, d, n, false);
426 case STATE_FULLSCREEN:
427 set_fullscreen(m, d, n, false);
431 put_status(SBSC_MASK_WINDOW_STATE, "window_state %s %s 0x%X %s off\n", m->name, d->name, c->window, STATESTR(c->last_state));
435 case STATE_PSEUDO_TILED:
438 set_floating(m, d, n, true);
440 case STATE_FULLSCREEN:
441 set_fullscreen(m, d, n, true);
445 put_status(SBSC_MASK_WINDOW_STATE, "window_state %s %s 0x%X %s on\n", m->name, d->name, c->window, STATESTR(c->state));
448 void set_floating(monitor_t *m, desktop_t *d, node_t *n, bool value)
454 n->split_mode = MODE_AUTOMATIC;
456 update_vacant_state(n->parent);
463 neutralize_obscuring_windows(m, d, n);
467 stack(n, (d->focus == n));
470 void set_fullscreen(monitor_t *m, desktop_t *d, node_t *n, bool value)
476 client_t *c = n->client;
478 n->split_mode = MODE_AUTOMATIC;
480 update_vacant_state(n->parent);
483 ewmh_wm_state_add(c, ewmh->_NET_WM_STATE_FULLSCREEN);
484 c->last_layer = c->layer;
485 c->layer = LAYER_ABOVE;
487 ewmh_wm_state_remove(c, ewmh->_NET_WM_STATE_FULLSCREEN);
488 c->layer = c->last_layer;
490 neutralize_obscuring_windows(m, d, n);
494 stack(n, (d->focus == n));
497 void neutralize_obscuring_windows(monitor_t *m, desktop_t *d, node_t *n)
500 for (node_t *a = first_extrema(d->root); a != NULL; a = next_leaf(a, d->root)) {
502 if (IS_FULLSCREEN(a->client) && stack_cmp(n->client, a->client) < 0) {
503 set_state(m, d, a, a->client->last_state);
513 void set_locked(monitor_t *m, desktop_t *d, node_t *n, bool value)
515 if (n == NULL || n->client->locked == value)
518 client_t *c = n->client;
520 put_status(SBSC_MASK_WINDOW_FLAG, "window_flag %s %s 0x%X locked %s\n", m->name, d->name, c->window, ONOFFSTR(value));
523 window_draw_border(n, d->focus == n, m == mon);
526 void set_sticky(monitor_t *m, desktop_t *d, node_t *n, bool value)
528 if (n == NULL || n->client->sticky == value)
531 client_t *c = n->client;
533 put_status(SBSC_MASK_WINDOW_FLAG, "window_flag %s %s 0x%X sticky %s\n", m->name, d->name, c->window, ONOFFSTR(value));
536 transfer_node(m, d, n, m, m->desk, m->desk->focus);
540 ewmh_wm_state_add(c, ewmh->_NET_WM_STATE_STICKY);
543 ewmh_wm_state_remove(c, ewmh->_NET_WM_STATE_STICKY);
547 window_draw_border(n, d->focus == n, m == mon);
550 void set_private(monitor_t *m, desktop_t *d, node_t *n, bool value)
552 if (n == NULL || n->client->private == value)
555 client_t *c = n->client;
557 put_status(SBSC_MASK_WINDOW_FLAG, "window_flag %s %s 0x%X private %s\n", m->name, d->name, c->window, ONOFFSTR(value));
560 update_privacy_level(n, value);
561 window_draw_border(n, d->focus == n, m == mon);
564 void set_urgency(monitor_t *m, desktop_t *d, node_t *n, bool value)
566 if (value && mon->desk->focus == n)
568 n->client->urgent = value;
569 window_draw_border(n, d->focus == n, m == mon);
571 put_status(SBSC_MASK_WINDOW_FLAG, "window_flag %s %s 0x%X urgent %s\n", m->name, d->name, n->client->window, ONOFFSTR(value));
572 put_status(SBSC_MASK_REPORT);
575 uint32_t get_border_color(client_t *c, bool focused_window, bool focused_monitor)
582 if (focused_monitor && focused_window) {
584 get_color(focused_locked_border_color, c->window, &pxl);
586 get_color(focused_sticky_border_color, c->window, &pxl);
588 get_color(focused_private_border_color, c->window, &pxl);
590 get_color(focused_border_color, c->window, &pxl);
591 } else if (focused_window) {
593 get_color(urgent_border_color, c->window, &pxl);
595 get_color(active_locked_border_color, c->window, &pxl);
597 get_color(active_sticky_border_color, c->window, &pxl);
599 get_color(active_private_border_color, c->window, &pxl);
601 get_color(active_border_color, c->window, &pxl);
604 get_color(urgent_border_color, c->window, &pxl);
606 get_color(normal_locked_border_color, c->window, &pxl);
608 get_color(normal_sticky_border_color, c->window, &pxl);
610 get_color(normal_private_border_color, c->window, &pxl);
612 get_color(normal_border_color, c->window, &pxl);
618 void update_floating_rectangle(client_t *c)
620 xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply(dpy, xcb_get_geometry(dpy, c->window), NULL);
623 c->floating_rectangle = (xcb_rectangle_t) {geo->x, geo->y, geo->width, geo->height};
628 void restrain_floating_width(client_t *c, int *width)
632 if (c->min_width > 0 && *width < c->min_width)
633 *width = c->min_width;
634 else if (c->max_width > 0 && *width > c->max_width)
635 *width = c->max_width;
638 void restrain_floating_height(client_t *c, int *height)
642 if (c->min_height > 0 && *height < c->min_height)
643 *height = c->min_height;
644 else if (c->max_height > 0 && *height > c->max_height)
645 *height = c->max_height;
648 void restrain_floating_size(client_t *c, int *width, int *height)
650 restrain_floating_width(c, width);
651 restrain_floating_height(c, height);
654 void query_pointer(xcb_window_t *win, xcb_point_t *pt)
656 window_lower(motion_recorder);
658 xcb_query_pointer_reply_t *qpr = xcb_query_pointer_reply(dpy, xcb_query_pointer(dpy, root), NULL);
664 *pt = (xcb_point_t) {qpr->root_x, qpr->root_y};
668 window_raise(motion_recorder);
671 void window_border_width(xcb_window_t win, uint32_t bw)
673 uint32_t values[] = {bw};
674 xcb_configure_window(dpy, win, XCB_CONFIG_WINDOW_BORDER_WIDTH, values);
677 void window_move(xcb_window_t win, int16_t x, int16_t y)
679 uint32_t values[] = {x, y};
680 xcb_configure_window(dpy, win, XCB_CONFIG_WINDOW_X_Y, values);
683 void window_resize(xcb_window_t win, uint16_t w, uint16_t h)
685 uint32_t values[] = {w, h};
686 xcb_configure_window(dpy, win, XCB_CONFIG_WINDOW_WIDTH_HEIGHT, values);
689 void window_move_resize(xcb_window_t win, int16_t x, int16_t y, uint16_t w, uint16_t h)
691 uint32_t values[] = {x, y, w, h};
692 xcb_configure_window(dpy, win, XCB_CONFIG_WINDOW_X_Y_WIDTH_HEIGHT, values);
695 void window_raise(xcb_window_t win)
697 uint32_t values[] = {XCB_STACK_MODE_ABOVE};
698 xcb_configure_window(dpy, win, XCB_CONFIG_WINDOW_STACK_MODE, values);
701 void window_center(monitor_t *m, client_t *c)
703 xcb_rectangle_t *r = &c->floating_rectangle;
704 xcb_rectangle_t a = m->rectangle;
705 if (r->width >= a.width)
708 r->x = a.x + (a.width - r->width) / 2;
709 if (r->height >= a.height)
712 r->y = a.y + (a.height - r->height) / 2;
713 r->x -= c->border_width;
714 r->y -= c->border_width;
717 void window_stack(xcb_window_t w1, xcb_window_t w2, uint32_t mode)
721 uint16_t mask = XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE;
722 uint32_t values[] = {w2, mode};
723 xcb_configure_window(dpy, w1, mask, values);
726 void window_above(xcb_window_t w1, xcb_window_t w2)
728 window_stack(w1, w2, XCB_STACK_MODE_ABOVE);
731 void window_below(xcb_window_t w1, xcb_window_t w2)
733 window_stack(w1, w2, XCB_STACK_MODE_BELOW);
736 void window_lower(xcb_window_t win)
738 uint32_t values[] = {XCB_STACK_MODE_BELOW};
739 xcb_configure_window(dpy, win, XCB_CONFIG_WINDOW_STACK_MODE, values);
742 void window_set_visibility(xcb_window_t win, bool visible)
744 uint32_t values_off[] = {ROOT_EVENT_MASK & ~XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY};
745 uint32_t values_on[] = {ROOT_EVENT_MASK};
746 xcb_change_window_attributes(dpy, root, XCB_CW_EVENT_MASK, values_off);
748 xcb_map_window(dpy, win);
750 xcb_unmap_window(dpy, win);
751 xcb_change_window_attributes(dpy, root, XCB_CW_EVENT_MASK, values_on);
754 void window_hide(xcb_window_t win)
756 window_set_visibility(win, false);
759 void window_show(xcb_window_t win)
761 window_set_visibility(win, true);
764 void toggle_visibility(void)
769 for (monitor_t *m = mon_head; m != NULL; m = m->next)
770 for (node_t *n = first_extrema(m->desk->root); n != NULL; n = next_leaf(n, m->desk->root))
771 window_set_visibility(n->client->window, visible);
773 update_input_focus();
776 void enable_motion_recorder(void)
778 window_raise(motion_recorder);
779 window_show(motion_recorder);
782 void disable_motion_recorder(void)
784 window_hide(motion_recorder);
787 void update_motion_recorder(void)
789 xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply(dpy, xcb_get_geometry(dpy, root), NULL);
792 window_resize(motion_recorder, geo->width, geo->height);
798 void update_input_focus(void)
800 set_input_focus(mon->desk->focus);
803 void set_input_focus(node_t *n)
808 if (n->client->icccm_input) {
809 xcb_set_input_focus(dpy, XCB_INPUT_FOCUS_PARENT, n->client->window, XCB_CURRENT_TIME);
810 } else if (n->client->icccm_focus) {
811 send_client_message(n->client->window, ewmh->WM_PROTOCOLS, WM_TAKE_FOCUS);
816 void clear_input_focus(void)
818 xcb_set_input_focus(dpy, XCB_INPUT_FOCUS_POINTER_ROOT, root, XCB_CURRENT_TIME);
821 void center_pointer(xcb_rectangle_t r)
823 int16_t cx = r.x + r.width / 2;
824 int16_t cy = r.y + r.height / 2;
825 window_lower(motion_recorder);
826 xcb_warp_pointer(dpy, XCB_NONE, root, 0, 0, 0, 0, cx, cy);
827 window_raise(motion_recorder);
830 void get_atom(char *name, xcb_atom_t *atom)
832 xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(dpy, xcb_intern_atom(dpy, 0, strlen(name), name), NULL);
840 void set_atom(xcb_window_t win, xcb_atom_t atom, uint32_t value)
842 xcb_change_property(dpy, XCB_PROP_MODE_REPLACE, win, atom, XCB_ATOM_CARDINAL, 32, 1, &value);
845 bool has_proto(xcb_atom_t atom, xcb_icccm_get_wm_protocols_reply_t *protocols)
847 for (uint32_t i = 0; i < protocols->atoms_len; i++)
848 if (protocols->atoms[i] == atom)
853 void send_client_message(xcb_window_t win, xcb_atom_t property, xcb_atom_t value)
855 xcb_client_message_event_t e;
857 e.response_type = XCB_CLIENT_MESSAGE;
862 e.data.data32[0] = value;
863 e.data.data32[1] = XCB_CURRENT_TIME;
865 xcb_send_event(dpy, false, win, XCB_EVENT_MASK_NO_EVENT, (char *) &e);