4 #include <xcb/xcb_event.h>
11 void handle_event(xcb_generic_event_t *evt)
13 switch (XCB_EVENT_RESPONSE_TYPE(evt)) {
15 PUTS("received a map request\n");
18 case XCB_CONFIGURE_REQUEST:
19 PUTS("received a configure request\n");
22 /* PUTS("ungrab key received"); */
25 PUTS("keypress received");
28 PUTS("keyrelease received");
30 case XCB_BUTTON_PRESS:
31 case XCB_BUTTON_RELEASE:
35 PRINTF("received event %i\n", XCB_EVENT_RESPONSE_TYPE(evt));
39 void map_request(xcb_generic_event_t *evt)
41 xcb_map_request_event_t *e = (xcb_map_request_event_t *) evt;
42 xcb_get_window_attributes_reply_t *wa;
43 xcb_window_t win = e->window;
44 wa = xcb_get_window_attributes_reply(dpy, xcb_get_window_attributes(dpy, win), NULL);
45 if ((wa != NULL && wa->override_redirect) || win_to_node(win) != NULL)
48 client_t *c = make_client();
51 node_t *focus = desk->focus;