diff options
-rw-r--r-- | driver/multitouch.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/driver/multitouch.c b/driver/multitouch.c index c9b8bce..99f1484 100644 --- a/driver/multitouch.c +++ b/driver/multitouch.c @@ -26,6 +26,10 @@ #include <xserver-properties.h> #endif +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 +typedef InputInfoPtr LocalDevicePtr; +#endif + /* these should be user-configurable at some point */ static const float vscroll_fraction = 0.025; static const float hscroll_fraction = 0.05; @@ -134,7 +138,11 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local) #endif mt->caps.abs[MTDEV_POSITION_X].minimum, mt->caps.abs[MTDEV_POSITION_X].maximum, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 + 1, 0, 1, Absolute); +#else 1, 0, 1); +#endif xf86InitValuatorDefaults(dev, 0); xf86InitValuatorAxisStruct(dev, 1, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 @@ -142,7 +150,11 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local) #endif mt->caps.abs[MTDEV_POSITION_Y].minimum, mt->caps.abs[MTDEV_POSITION_Y].maximum, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 + 1, 0, 1, Absolute); +#else 1, 0, 1); +#endif xf86InitValuatorDefaults(dev, 1); XIRegisterPropertyHandler(dev, pointer_property, NULL, NULL); @@ -289,6 +301,26 @@ static Bool device_control(DeviceIntPtr dev, int mode) } +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12 +static int preinit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) +{ + struct MTouch *mt; + + mt = calloc(1, sizeof(*mt)); + if (!mt) + return BadAlloc; + + pInfo->private = mt; + pInfo->type_name = XI_TOUCHPAD; + pInfo->device_control = device_control; + pInfo->read_input = read_input; + pInfo->switch_mode = 0; + //xf86CollectInputOptions(local, NULL); + //xf86ProcessCommonOptions(local, local->options); + + return Success; +} +#else static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags) { struct MTouch *mt; @@ -315,6 +347,7 @@ static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags) error: return local; } +#endif static void uninit(InputDriverPtr drv, InputInfoPtr local, int flags) { |