diff --git a/configure.ac b/configure.ac index 60261978b5e86a0d1ed8928d2a6455ad4e964fda..3729591f4400f1bcfea3889c152d7ebc17bf7a99 100644 --- a/configure.ac +++ b/configure.ac @@ -44,23 +44,13 @@ XORG_MACROS_VERSION(1.8) XORG_DEFAULT_OPTIONS # Obtain compiler/linker options from server and required extensions -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto [inputproto >= 2.2]) -PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.7.0]) +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.19] xproto [inputproto >= 2.2]) +PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.11.0]) OLD_LIBS=$LIBS OLD_CFLAGS=$CFLAGS LIBS="$LIBS $LIBINPUT_LIBS" CFLAGS="$CFLAGS $LIBINPUT_CFLAGS" -AC_MSG_CHECKING([if libinput_device_touch_get_touch_count is available]) -AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[libinput_device_touch_get_touch_count(NULL)]])], - [AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_LIBINPUT_TOUCH_COUNT, [1], - [libinput_device_touch_get_touch_count() is available]) - [libinput_have_touch_count=yes]], - [AC_MSG_RESULT([no]) - [libinput_have_touch_count=no]]) AC_MSG_CHECKING([if libinput_device_config_scroll_get_button_lock is available]) AC_LINK_IFELSE( diff --git a/src/xf86libinput.c b/src/xf86libinput.c index d6da6e36004f8f98b223211bc852ada2d3be5e3d..e86e717941e2a53d93bf0a31606177d995add472 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -46,20 +46,6 @@ #include "draglock.h" #include "libinput-properties.h" -#ifndef XI86_SERVER_FD -#define XI86_SERVER_FD 0x20 -#endif - -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) * 1000 + GET_ABI_MINOR(ABI_XINPUT_VERSION) > 22000 -#define HAVE_VMASK_UNACCEL 1 -#else -#undef HAVE_VMASK_UNACCEL -#endif - -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23 -#define HAVE_THREADED_INPUT 1 -#endif - #define TOUCHPAD_NUM_AXES 4 /* x, y, hscroll, vscroll */ #define TABLET_NUM_BUTTONS 7 /* we need scroll buttons */ #define TOUCH_MAX_SLOTS 15 @@ -820,13 +806,8 @@ xf86libinput_on(DeviceIntPtr dev) pInfo->fd = libinput_get_fd(libinput); if (driver_context.device_enabled_count == 0) { -#if HAVE_THREADED_INPUT xf86AddEnabledDevice(pInfo); driver_context.registered_InputInfoPtr = pInfo; -#else - /* Can't use xf86AddEnabledDevice on an epollfd */ - AddEnabledDevice(pInfo->fd); -#endif } driver_context.device_enabled_count++; @@ -845,11 +826,7 @@ xf86libinput_off(DeviceIntPtr dev) struct xf86libinput_device *shared_device = driver_data->shared_device; if (--driver_context.device_enabled_count == 0) { -#if HAVE_THREADED_INPUT xf86RemoveEnabledDevice(pInfo); -#else - RemoveEnabledDevice(pInfo->fd); -#endif } if (use_server_fd(pInfo)) { @@ -1104,11 +1081,9 @@ xf86libinput_init_touch(InputInfoPtr pInfo) XIGetKnownProperty(AXIS_LABEL_PROP_ABS_MT_POSITION_Y), min, max, res * 1000, 0, res * 1000, Absolute); -#if HAVE_LIBINPUT_TOUCH_COUNT ntouches = libinput_device_touch_get_touch_count(device); if (ntouches == 0) /* unknown - mtdev */ ntouches = TOUCH_MAX_SLOTS; -#endif InitTouchClassDeviceStruct(dev, ntouches, XIDirectTouch, 2); } @@ -1407,19 +1382,11 @@ swap_registered_device(InputInfoPtr pInfo) while (next == pInfo || !is_libinput_device(next)) next = next->next; -#if HAVE_THREADED_INPUT input_lock(); -#else - int sigstate = xf86BlockSIGIO(); -#endif xf86RemoveEnabledDevice(pInfo); xf86AddEnabledDevice(next); driver_context.registered_InputInfoPtr = next; -#if HAVE_THREADED_INPUT input_unlock(); -#else - xf86UnblockSIGIO(sigstate); -#endif } static void @@ -1488,7 +1455,6 @@ xf86libinput_handle_motion(InputInfoPtr pInfo, struct libinput_event_pointer *ev valuator_mask_zero(mask); -#if HAVE_VMASK_UNACCEL { double ux, uy; @@ -1498,10 +1464,6 @@ xf86libinput_handle_motion(InputInfoPtr pInfo, struct libinput_event_pointer *ev valuator_mask_set_unaccelerated(mask, 0, x, ux); valuator_mask_set_unaccelerated(mask, 1, y, uy); } -#else - valuator_mask_set_double(mask, 0, x); - valuator_mask_set_double(mask, 1, y); -#endif xf86PostMotionEventM(dev, Relative, mask); } @@ -3239,20 +3201,12 @@ xf86libinput_hotplug_device(struct xf86libinput_hotplug_info *hotplug) { DeviceIntPtr dev; -#if HAVE_THREADED_INPUT input_lock(); -#else - int sigstate = xf86BlockSIGIO(); -#endif if (NewInputDeviceRequest(hotplug->input_options, hotplug->attrs, &dev) != Success) dev = NULL; -#if HAVE_THREADED_INPUT input_unlock(); -#else - xf86UnblockSIGIO(sigstate); -#endif input_option_free_list(&hotplug->input_options); FreeInputAttributes(hotplug->attrs); @@ -3552,9 +3506,7 @@ InputDriverRec xf86libinput_driver = { .UnInit = xf86libinput_uninit, .module = NULL, .default_options= NULL, -#ifdef XI86_DRV_CAP_SERVER_FD .capabilities = XI86_DRV_CAP_SERVER_FD -#endif }; static XF86ModuleVersionInfo xf86libinput_version_info = {