[XInput] Get XInput working again.

Check for distros shipping out of sync header vs libXi,
call in g_type_init() in test-devices, fix ifdef so
XInput events get correctly selected.
This commit is contained in:
Matthew Allum 2009-06-17 15:09:16 +01:00
parent 3035092edb
commit 1aa8c89f2c
3 changed files with 13 additions and 4 deletions

View File

@ -182,7 +182,7 @@ clutter_stage_glx_realize (ClutterActor *actor)
KeyPressMask | KeyReleaseMask |
EnterWindowMask | LeaveWindowMask |
PropertyChangeMask);
#ifdef USE_XINPUT
#ifdef HAVE_XINPUT
_clutter_x11_select_events (stage_x11->xwin);
#endif
}

View File

@ -503,7 +503,6 @@ AS_IF([test "x$clutterbackend" = "xglx" || test "x$clutterbackend" = "xeglx"],
# XINPUT (optional) - FIXME this is wrong
xinput=no
AC_MSG_CHECKING([for XINPUT extension])
AC_ARG_ENABLE([xinput],
[AS_HELP_STRING([--enable-xinput], [Use the XINPUT X extension])],
[
@ -543,7 +542,16 @@ AS_IF([test "x$clutterbackend" = "xglx" || test "x$clutterbackend" = "xeglx"],
[Define to 1 if we have XGetExtensionVersion])
])
#Seems some distros ship with the header but not the symbol
really_have_xinput_query_version=no
AS_IF([test "x$have_xquery_input_version" = "xyes"],
[
AC_CHECK_LIB(Xi, [XQueryInputVersion],
[really_have_xinput_query_version=yes],
[])
])
AS_IF([test "x$really_have_xquery_input_version" = "xyes"],
[
AC_DEFINE([HAVE_XQUERY_INPUT_VERSION],
[1],
@ -553,11 +561,10 @@ AS_IF([test "x$clutterbackend" = "xglx" || test "x$clutterbackend" = "xeglx"],
X11_LIBS="$X11_LIBS -lXi"
X11_PC_FILES="$X11_PC_FILES xi"
AC_MSG_RESULT([found])
],
[no],
[AC_MSG_RESULT([not found or disabled])],
[],
)
# X11-specific tests are enabled conditionally

View File

@ -33,6 +33,8 @@ test_devices_main (int argc, char **argv)
TestDevicesApp *app = NULL;
ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff };
g_type_init();
clutter_x11_enable_xinput ();
clutter_init (&argc, &argv);