summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2019-09-04 10:03:13 -0700
committerJason Gerecke <killertofu@gmail.com>2019-09-19 13:53:55 -0700
commit009f7424a21cd56404c9827d69e6920551bf43c8 (patch)
tree3e1db54bce0efdd16148c5813a58f3f91d490b76
parent31a5405f7d9405bc514585709161287b0c67386e (diff)
downloadxf86-input-wacom-009f7424a21cd56404c9827d69e6920551bf43c8.tar.gz
Perform a few cleanups in wcmTouchFilter.c
Removes the #ifdef compile guards around the code that checks if gestures are disabled prior to doing multitouch processing. They aren't strictly necessary, and actually prevent "gesture off" from having an effect on older X servers. Also removes a vestigial check in wcmFingerMultitouch. The original version of the function would only be called once two or more fingers were down. This gave wcmSingleFingerPress a chance to send a left-click event when just a single finger came in contact with the touchscreen. Later it was realized that the MT protocol requires us to send even *single* touch events for touchscreens through its API, so the code was changed to *always* call wcmFingerMultitouch when a touchscreen was in use. This had the side-effect of never calling wcmSingleFingerPress, rendering this check useless. Also removes some unnecessary checks from the zoom/scroll processing that are either already handled by pre-conditions above or have no real effect. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r--src/wcmTouchFilter.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
index 41baa12..d759d23 100644
--- a/src/wcmTouchFilter.c
+++ b/src/wcmTouchFilter.c
@@ -154,14 +154,6 @@ wcmFingerMultitouch(WacomDevicePtr priv, int contact_id) {
Bool prox = FALSE;
int i;
- if (lag_mode && TabletHasFeature(priv->common, WCM_LCD)) {
- /* wcmSingleFingerPress triggers a button press as
- * soon as a single finger appears. ensure we release
- * that button before getting too far along
- */
- wcmSendButtonClick(priv, 1, 0);
- }
-
for (i = 0; i < MAX_CHANNELS; i++) {
WacomChannelPtr channel = priv->common->wcmChannel+i;
WacomDeviceState state = channel->valid.state;
@@ -548,23 +540,18 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id)
if (common->wcmGestureMode & GESTURE_TAP_MODE)
goto ret;
- /* skip initial finger event for scroll and zoom */
- if (!dsLast[0].proximity || !dsLast[1].proximity)
- goto ret;
-
/* continue zooming if already in zoom mode */
- if ((common->wcmGestureMode & GESTURE_ZOOM_MODE) &&
- ds[0].proximity && ds[1].proximity)
+ if ((common->wcmGestureMode & GESTURE_ZOOM_MODE))
wcmFingerZoom(priv);
/* continue scrollling if already in scroll mode */
else if (common->wcmGestureMode & GESTURE_SCROLL_MODE)
- wcmFingerScroll(priv);
+ wcmFingerScroll(priv);
/* process complex two finger gestures */
- else {
- if (ds[0].proximity && ds[1].proximity)
- {
+ else if (ds[0].proximity && ds[1].proximity)
+ {
+ if (dsLast[0].proximity && dsLast[1].proximity) {
/* scroll should be considered first since it requires
* a finger distance check */
wcmFingerScroll(priv);
@@ -575,7 +562,6 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id)
}
ret:
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 16
/* Send multitouch data to X if appropriate */
if (!common->wcmGesture) {
if (common->wcmGestureMode == GESTURE_NONE_MODE) {
@@ -589,7 +575,6 @@ ret:
common->wcmGestureMode == GESTURE_MULTITOUCH_MODE)
wcmFingerMultitouch(priv, touch_id);
}
-#endif
if ((common->wcmGestureMode == GESTURE_NONE_MODE || common->wcmGestureMode == GESTURE_DRAG_MODE) &&
touch_id == 0)