Otherwise we can just fall back to xcb_poll_for_event, and just do a
harmless read on the socket.
if (mask & WL_EVENT_READABLE) {
*event = xcb_poll_for_event(c->conn);
} else {
+#ifdef HAVE_XCB_POLL_FOR_QUEUED_EVENT
*event = xcb_poll_for_queued_event(c->conn);
+#else
+ *event = xcb_poll_for_event(c->conn);
+#endif
}
return *event != NULL;
PKG_PROG_PKG_CONFIG()
+PKG_CHECK_MODULES([XCB], xcb)
+xcb_save_LIBS=$LIBS
+xcb_save_CFLAGS=$CFLAGS
+CFLAGS=$XCB_CFLAGS
+LIBS=$XCB_LIBS
+AC_CHECK_FUNCS([xcb_poll_for_queued_event])
+LIBS=$xcb_save_LIBS
+CFLAGS=$xcb_save_CFLAGS
+
AC_CHECK_FUNC([dlopen], [],
AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
AC_SUBST(DLOPEN_LIBS)