When touchpad is in Relative mode of operation, we need allow driver
update internal old{x,y,z} variables to eliminate cursor jump after
gesture ended. That update performed in wcmSendEvents() function in
wcmCommon.c. So, when we in gesture mode, allow call wcmSendEvents()
to update variables, but don't allow actual events sending to X server.Unnecessary axes modification removed from wcmSendButtonClick() in wcmTouchFilter.c, which was causing cursor movement in Absolute mode while gestures are active with respect to above changes. Call to xf86PostButtonEvent() replaced by call to xf86PostButtonEventP(). Signed-off-by: Alexey Osipov <[email protected]> --- Changes to previous version: - Call to xf86PostButtonEvent() replaced by call to xf86PostButtonEventP() This patch was: Reviewed-by: Chris Bagwell <[email protected]> src/wcmCommon.c | 11 +++++------ src/wcmTouchFilter.c | 12 ++---------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/wcmCommon.c b/src/wcmCommon.c index 21afcc5..10a154c 100644 --- a/src/wcmCommon.c +++ b/src/wcmCommon.c @@ -810,8 +810,11 @@ void wcmSendEvents(InputInfoPtr pInfo, const WacomDeviceState* ds) if (type == PAD_ID) wcmSendPadEvents(pInfo, ds, 3, priv->naxes - 3, &valuators[3]); /* pad doesn't post x/y/z */ - else - wcmSendNonPadEvents(pInfo, ds, 0, priv->naxes, valuators); + else { + /* don't move the cursor if in gesture mode */ + if (!priv->common->wcmGestureMode) + wcmSendNonPadEvents(pInfo, ds, 0, priv->naxes, valuators); + } priv->oldProximity = ds->proximity; if (ds->proximity) @@ -1008,10 +1011,6 @@ void wcmEvent(WacomCommonPtr common, unsigned int channel, if ((ds.device_type == TOUCH_ID) && common->wcmTouch) wcmGestureFilter(priv, channel); - /* don't move the cursor if in gesture mode */ - if (common->wcmGestureMode) - return; - /* For touch, only first finger moves the cursor */ if ((ds.device_type == TOUCH_ID && common->wcmTouch && !channel) || (ds.device_type != TOUCH_ID)) diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index 047490b..6314110 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -93,19 +93,11 @@ static Bool pointsInLine(WacomCommonPtr common, WacomDeviceState ds0, /* send a button event */ static void wcmSendButtonClick(WacomDevicePtr priv, int button, int state) { - int x = 0; - int y = 0; int mode = is_absolute(priv->pInfo); - if (mode) - { - x = priv->oldX; - y = priv->oldY; - } - /* send button event in state */ - xf86PostButtonEvent(priv->pInfo->dev, mode,button, - state,0,priv->naxes,x,y,0,0,0,0); + xf86PostButtonEventP(priv->pInfo->dev, mode,button, + state,0,0,0); /* We have changed the button state (from down to up) for the device * so we need to update the record */ -- 1.7.0.4 ------------------------------------------------------------------------------ Write once. Port to many. Get the SDK and tools to simplify cross-platform app development. Create new or port existing apps to sell to consumers worldwide. Explore the Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join http://p.sf.net/sfu/intel-appdev _______________________________________________ Linuxwacom-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
