diff options
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | src/xf86libinput.c | 8 |
2 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 268e030..6a1912a 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,18 @@ AC_SUBST(xorgconfdir) # X Server SDK location is required to install header files sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server` +SAVE_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" + +AC_CHECK_DECL(xf86AddEnabledDeviceSerialized, + [AC_DEFINE(HAVE_ADD_ENABLED_DEVICE_SERIALIZED, 1, [have xf86AddEnabledDeviceSerialized API])], + [], + [#include <xorg-server.h> + #include <xf86Xinput.h>]) + +CPPFLAGS="$SAVE_CPPFLAGS" + + # Workaround overriding sdkdir to be able to create a tarball when user has no # write permission in sdkdir. See DISTCHECK_CONFIGURE_FLAGS in Makefile.am AC_ARG_WITH([sdkdir], [], [sdkdir="$withval"]) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index ee2165a..16abe76 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -480,8 +480,12 @@ xf86libinput_on(DeviceIntPtr dev) pInfo->fd = libinput_get_fd(libinput); if (driver_context.device_enabled_count == 0) { +#if HAVE_ADD_ENABLED_DEVICE_SERIALIZED + xf86AddEnabledDeviceSerialized(pInfo); +#else /* Can't use xf86AddEnabledDevice on an epollfd */ AddEnabledDevice(pInfo->fd); +#endif } driver_context.device_enabled_count++; @@ -500,7 +504,11 @@ xf86libinput_off(DeviceIntPtr dev) struct xf86libinput_device *shared_device = driver_data->shared_device; if (--driver_context.device_enabled_count == 0) { +#if HAVE_ADD_ENABLED_DEVICE_SERIALIZED + xf86RemoveEnabledDevice(pInfo); +#else RemoveEnabledDevice(pInfo->fd); +#endif } if (use_server_fd(pInfo)) { |