compositor-x11: Remove support for ancient XCB
We had two non-pkg-config check paths in the configure script, to support XCB functionality used before XCB had had an accompanying release: xcb_poll_for_queued_event (released in 1.8, 2012), and a usable XKB event mechanism (released in 1.9, 2013). Convert the former to a version-based hard dependency, and the latter to a version-based soft dependency. This avoids two compiler checks. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
b51e6ed710
commit
f86e67d01f
21
configure.ac
21
configure.ac
|
@ -185,28 +185,11 @@ AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],,
|
||||||
AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
|
AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)
|
||||||
have_xcb_xkb=no
|
have_xcb_xkb=no
|
||||||
if test x$enable_x11_compositor = xyes; then
|
if test x$enable_x11_compositor = xyes; then
|
||||||
PKG_CHECK_MODULES([XCB], xcb)
|
PKG_CHECK_MODULES([XCB], xcb >= 1.8)
|
||||||
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
|
|
||||||
|
|
||||||
X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm"
|
X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm"
|
||||||
|
|
||||||
PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb],
|
PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb >= 1.9],
|
||||||
[have_xcb_xkb="yes"], [have_xcb_xkb="no"])
|
[have_xcb_xkb="yes"], [have_xcb_xkb="no"])
|
||||||
if test "x$have_xcb_xkb" = xyes; then
|
|
||||||
# Most versions of XCB have totally broken XKB bindings, where the
|
|
||||||
# events don't work. Make sure we can actually use them.
|
|
||||||
xcb_xkb_save_CFLAGS=$CFLAGS
|
|
||||||
CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS
|
|
||||||
AC_CHECK_MEMBER([struct xcb_xkb_state_notify_event_t.xkbType],
|
|
||||||
[], [have_xcb_xkb=no], [[#include <xcb/xkb.h>]])
|
|
||||||
CFLAGS=$xcb_xkb_save_CFLAGS
|
|
||||||
fi
|
|
||||||
if test "x$have_xcb_xkb" = xyes; then
|
if test "x$have_xcb_xkb" = xyes; then
|
||||||
X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
|
X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb"
|
||||||
AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
|
AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol])
|
||||||
|
|
|
@ -1298,15 +1298,10 @@ static int
|
||||||
x11_backend_next_event(struct x11_backend *b,
|
x11_backend_next_event(struct x11_backend *b,
|
||||||
xcb_generic_event_t **event, uint32_t mask)
|
xcb_generic_event_t **event, uint32_t mask)
|
||||||
{
|
{
|
||||||
if (mask & WL_EVENT_READABLE) {
|
if (mask & WL_EVENT_READABLE)
|
||||||
*event = xcb_poll_for_event(b->conn);
|
*event = xcb_poll_for_event(b->conn);
|
||||||
} else {
|
else
|
||||||
#ifdef HAVE_XCB_POLL_FOR_QUEUED_EVENT
|
|
||||||
*event = xcb_poll_for_queued_event(b->conn);
|
*event = xcb_poll_for_queued_event(b->conn);
|
||||||
#else
|
|
||||||
*event = xcb_poll_for_event(b->conn);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
return *event != NULL;
|
return *event != NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue