The X server provides pointer emulation for the first touch on direct-input (touchscreen) devices. To make use of this, we need to short-circuit our internal first-touch emulation and that the gesture engine immediately enters multitouch mode (but only for touchscreens!)
Signed-off-by: Jason Gerecke <killert...@gmail.com> --- src/wcmCommon.c | 10 ++++++++++ src/wcmTouchFilter.c | 16 +++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 943f34d..0e1f29e 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -995,7 +995,17 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel, } if ((ds.device_type == TOUCH_ID) && common->wcmTouch) + { wcmGestureFilter(priv, ds.serial_num - 1); +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 16 + /* + * When using XI 2.2 multitouch events don't do common dispatching + * for direct touch devices + */ + if (!common->wcmGesture && TabletHasFeature(common, WCM_LCD)) + return; +#endif + } /* For touch, only first finger moves the cursor */ if ((common->wcmTouch && ds.device_type == TOUCH_ID && ds.serial_num == 1) || diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index 3310560..b1ac4cd 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -555,11 +555,17 @@ ret: #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 16 /* Send multitouch data to X if appropriate */ - if (!common->wcmGesture && ds[1].proximity && common->wcmGestureMode == GESTURE_NONE_MODE) - common->wcmGestureMode = GESTURE_LAG_MODE; - if (!common->wcmGesture && (common->wcmGestureMode == GESTURE_LAG_MODE || - common->wcmGestureMode == GESTURE_MULTITOUCH_MODE)) { - wcmFingerMultitouch(priv, touch_id); + if (!common->wcmGesture) { + if (common->wcmGestureMode == GESTURE_NONE_MODE) { + if (TabletHasFeature(common, WCM_LCD)) + common->wcmGestureMode = GESTURE_MULTITOUCH_MODE; + else if (ds[1].proximity) + common->wcmGestureMode = GESTURE_LAG_MODE; + } + + if (common->wcmGestureMode == GESTURE_LAG_MODE || + common->wcmGestureMode == GESTURE_MULTITOUCH_MODE) + wcmFingerMultitouch(priv, touch_id); } #endif -- 2.1.0 ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel