From: Chris Bagwell <[email protected]>
Signed-off-by: Chris Bagwell <[email protected]>
---
src/wcmTouchFilter.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
index d2b2cf2..57a62f6 100644
--- a/src/wcmTouchFilter.c
+++ b/src/wcmTouchFilter.c
@@ -29,6 +29,7 @@
#define WACOM_VERT_ALLOWED 2
#define WACOM_GESTURE_LAG_TIME 10
+#define GESTURE_NONE_MODE 0
#define GESTURE_TAP_MODE 1
#define GESTURE_SCROLL_MODE 2
#define GESTURE_ZOOM_MODE 4
@@ -221,7 +222,7 @@ void wcmGestureFilter(WacomDevicePtr priv, int channel)
*/
if (ds[0].proximity && ds[1].proximity)
{
- if (!common->wcmGestureMode)
+ if (common->wcmGestureMode == GESTURE_NONE_MODE)
common->wcmGestureMode = GESTURE_LAG_MODE;
}
/* When only 1 finger is in proximity, it can be in either LAG mode
@@ -243,14 +244,14 @@ void wcmGestureFilter(WacomDevicePtr priv, int channel)
/* Must have recently come into proximity. Change
* into LAG mode.
*/
- if (!common->wcmGestureMode)
+ if (common->wcmGestureMode == GESTURE_NONE_MODE)
common->wcmGestureMode = GESTURE_LAG_MODE;
}
else
{
/* Been in LAG mode long enough. Go to NONE mode. */
if (common->wcmGestureMode == GESTURE_LAG_MODE)
- common->wcmGestureMode = 0;
+ common->wcmGestureMode = GESTURE_NONE_MODE;
}
}
@@ -272,19 +273,20 @@ void wcmGestureFilter(WacomDevicePtr priv, int channel)
common->wcmGestureParameters.wcmGestureUsed = 0;
/* initialize the cursor position */
- if (!common->wcmGestureMode && !channel)
+ if (common->wcmGestureMode == GESTURE_NONE_MODE && !channel)
goto ret;
}
if (!ds[0].proximity && !ds[1].proximity)
{
/* first finger was out-prox when GestureMode was still on */
- if (!dsLast[0].proximity && common->wcmGestureMode)
+ if (!dsLast[0].proximity &&
+ common->wcmGestureMode != GESTURE_NONE_MODE)
/* send first finger out prox */
wcmSoftOutEvent(priv->pInfo);
/* exit gesture mode when both fingers are out */
- common->wcmGestureMode = 0;
+ common->wcmGestureMode = GESTURE_NONE_MODE;
common->wcmGestureParameters.wcmScrollDirection = 0;
goto ret;
@@ -328,7 +330,8 @@ void wcmGestureFilter(WacomDevicePtr priv, int channel)
}
}
ret:
- if (!common->wcmGestureMode && !channel && !is_absolute(priv->pInfo))
+ if (common->wcmGestureMode == GESTURE_NONE_MODE &&
+ !channel && !is_absolute(priv->pInfo))
wcmSingleFingerTap(priv);
}
--
1.7.6
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel