summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-03-06 07:45:04 -0500
committerMatthias Clasen <mclasen@redhat.com>2012-03-06 07:45:04 -0500
commit4b05f4178a60bc6a8e1d3706c5128cad34bf106f (patch)
treeb69de4360efe7c3ef5b675916c75ea89f571cea2 /configure.ac
parent74305597366d92a54692542078f653262041ebab (diff)
downloadgtk+-4b05f4178a60bc6a8e1d3706c5128cad34bf106f.tar.gz
configure.ac: Improve the checks for XInput 2.2
Check for the XIScrollClassInfo struct in addition to the existing check for XIAllowTouchEvents() because Ubuntu Oneiric seems to have an incomplete backport which has one but not the other. Based on a patch by Murray Cumming, https://bugzilla.gnome.org/show_bug.cgi?id=671453
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 15 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 17c560afb8..616ee78584 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1114,13 +1114,26 @@ if test "x$enable_x11_backend" = xyes; then
AC_CHECK_HEADER(X11/extensions/XInput2.h,
have_xinput2=yes
- X_EXTENSIONS="$X_EXTENSIONS XI2"
AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
gtk_save_LIBS="$LIBS"
LIBS="$LIBS -lXi"
- AC_CHECK_FUNC(XIAllowTouchEvents, AC_DEFINE(XINPUT_2_2, 1, [Define to 1 if XInput 2.2 is available]))
+
+ # Note that we also check that the XIScrollClassInfo struct is defined,
+ # because at least Ubuntu Oneiric seems to have XIAllowTouchEvents(), but not the XIScrollClassInfo struct.
+ AC_CHECK_FUNC([XIAllowTouchEvents],
+ [AC_CHECK_MEMBER([XIScrollClassInfo.number],
+ have_xinput2_2=yes
+ AC_DEFINE(XINPUT_2_2, 1, [Define to 1 if XInput 2.2 is available]),
+ have_xinput2_2=no,
+ [[#include <X11/extensions/XInput2.h>]])])
LIBS="$gtk_save_LIBS"
+
+ if test "x$have_xinput2_2" = "xyes"; then
+ X_EXTENSIONS="$X_EXTENSIONS XI2.2"
+ else
+ X_EXTENSIONS="$X_EXTENSIONS XI2"
+ fi
fi
AM_CONDITIONAL(XINPUT_2, test "x$have_xinput2" = "xyes")