diff options
author | Keith Packard <keithp@keithp.com> | 2015-12-07 15:33:39 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-12-07 17:03:12 -0800 |
commit | e09bb37311ea9ce866aec24729568a96b0deda43 (patch) | |
tree | 044a7450225412799e6938df51b845beebcf1d20 | |
parent | 1f43f3921f6ceebd9a0cb92ef998a930d5fc3a3e (diff) |
This lets the xfree86 layer change to the NotifyFd interface without
affecting the driver.
v2: Check for new API in configure.ac and use only if present
Signed-off-by: Keith Packard <keithp@keithp.com>
-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)) { |