diff options
author | Alexey Osipov <simba@lerlan.ru> | 2012-01-03 15:13:42 +0700 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2012-01-03 09:25:23 -0800 |
commit | a119545769f208d5722561a928a93824f87cdc81 (patch) | |
tree | dc293fd4d91773cb177f3f7d7ae73bf7f27d99ed | |
parent | 7a7af3eb1c5e809aa7020795b3c170f6360d6c5f (diff) |
Fix cursor jumping after zoom and scroll gestures when in Relative mode.
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 <simba@lerlan.ru>
Reviewed-by: Chris Bagwell <chris@cnpgabwell.com>
-rw-r--r-- | src/wcmCommon.c | 11 | ||||
-rw-r--r-- | 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 */ |