From 1aa8c89f2c18e01e9f36338c0609f58caaa90c3a Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Wed, 17 Jun 2009 15:09:16 +0100 Subject: [PATCH] [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. --- clutter/glx/clutter-stage-glx.c | 2 +- configure.ac | 13 ++++++++++--- tests/interactive/test-devices.c | 2 ++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/clutter/glx/clutter-stage-glx.c b/clutter/glx/clutter-stage-glx.c index 52f149e..f36a849 100644 --- a/clutter/glx/clutter-stage-glx.c +++ b/clutter/glx/clutter-stage-glx.c @@ -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 } diff --git a/configure.ac b/configure.ac index 2ba52d7..99b880f 100644 --- a/configure.ac +++ b/configure.ac @@ -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,8 +542,17 @@ 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], [Define to 1 if we have XQueryInputVersion]) @@ -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 diff --git a/tests/interactive/test-devices.c b/tests/interactive/test-devices.c index 504109d..ef4703a 100644 --- a/tests/interactive/test-devices.c +++ b/tests/interactive/test-devices.c @@ -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); -- 2.7.4