#include #include #include #include int handle_mapping_notify(void *ignored, xcb_connection_t *conn, xcb_mapping_notify_event_t *event) { printf("EV EV EV!\n"); xcb_flush(conn); return 0; } int main() { xcb_event_handlers_t evenths; int screens; xcb_connection_t *conn = xcb_connect(NULL, &screens); memset(&evenths, 0, sizeof(xcb_event_handlers_t)); xcb_event_handlers_init(conn, &evenths); xcb_event_set_mapping_notify_handler(&evenths, handle_mapping_notify, NULL); xcb_event_wait_for_event_loop(&evenths); }