void* presage_thread (void* label) { XEvent event; for (;;) { // get XEvIE event XNextEvent (dpy, &event); printf ("Got XEvent\n"); handle_x_event (event, GTK_WIDGET(label)); } return NULL; }
static void kt_xcb_event_handler(xcb_connection_t *c) { xcb_generic_event_t *event = NULL; while((event = xcb_poll_for_event(c))) { guint8 response_type; response_type = XCB_EVENT_RESPONSE_TYPE(event); if (response_type != 0) { handle_x_event(response_type, event); } } xcb_flush(c); }