summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wcmTouchFilter.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
index d759d23..dbd3c01 100644
--- a/src/wcmTouchFilter.c
+++ b/src/wcmTouchFilter.c
@@ -418,6 +418,30 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id)
return;
}
+ /* Send multitouch data to X if appropriate */
+ if (!common->wcmGesture) {
+ switch (common->wcmGestureMode) {
+ case GESTURE_CANCEL_MODE:
+ break;
+ case GESTURE_NONE_MODE:
+ if (TabletHasFeature(common, WCM_LCD))
+ common->wcmGestureMode = GESTURE_MULTITOUCH_MODE;
+ else if (ds[1].proximity)
+ common->wcmGestureMode = GESTURE_LAG_MODE;
+ /* fall through */
+ case GESTURE_LAG_MODE:
+ case GESTURE_MULTITOUCH_MODE:
+ if (common->wcmGestureMode != GESTURE_NONE_MODE)
+ wcmFingerMultitouch(priv, touch_id);
+ break;
+ default:
+ wcmCancelGesture(priv->pInfo);
+ break;
+ }
+ }
+ if (common->wcmGestureMode == GESTURE_MULTITOUCH_MODE)
+ return;
+
/* Do not process gestures while in CANCEL mode. Only reset back to
* NONE mode once all fingers have left the screen.
*/
@@ -429,9 +453,6 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id)
common->wcmGestureMode = GESTURE_NONE_MODE;
}
- if (common->wcmGestureMode == GESTURE_MULTITOUCH_MODE)
- goto ret;
-
/* When 2 fingers are in proximity, it must always be in one of
* the valid 2 fingers modes: LAG, SCROLL, or ZOOM.
* LAG mode is used while deciding between SCROLL and ZOOM and
@@ -561,21 +582,6 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id)
}
}
ret:
-
- /* Send multitouch data to X if appropriate */
- 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);
- }
-
if ((common->wcmGestureMode == GESTURE_NONE_MODE || common->wcmGestureMode == GESTURE_DRAG_MODE) &&
touch_id == 0)
{