tap: all fingers must remain pressed when checking moving range 32/324032/1
authorduna.oh <duna.oh@samsung.com>
Mon, 12 May 2025 11:10:37 +0000 (20:10 +0900)
committerduna.oh <duna.oh@samsung.com>
Mon, 12 May 2025 11:22:28 +0000 (20:22 +0900)
This patch fixes the issue where tap is unintentionally canceled
in the following scenario.

Three fingers tap:
1st touch down -> 2nd touch down -> 3rd touch down
-> taps' base_rect is calculated. (rectagle covering all three fingers)
-> touch up -> touch move
-> taps'current_rect is calcultated.(rectagle covering only two fingers)
The diff between base_rect and current_rect exceeds conf.moving_range.
-> tap canceled.

Change-Id: I32113a4089fdcdd46adfbb7770f485a560878360

src/e_mod_gesture_events.c

index 1bd561604aab0d13988e019d1822993ee118f655..864ceea970b24ceaae5fd534436d675d2723395a 100644 (file)
@@ -1717,20 +1717,24 @@ _e_gesture_process_tap_move(Ecore_Event_Mouse_Move *ev)
           _e_gesture_tap_cancel();
      }
 
-   _e_gesture_util_rect_get(taps->enabled_finger, &current_rect.x1, &current_rect.y1, &current_rect.x2, &current_rect.y2);
+   // only checking touch moves within moving range while all fingers are still pressed.
+   if (gesture->gesture_events.num_pressed == taps->enabled_finger)
+     {
+        _e_gesture_util_rect_get(taps->enabled_finger, &current_rect.x1, &current_rect.y1, &current_rect.x2, &current_rect.y2);
 
-   xx1 = taps->base_rect.x1 - current_rect.x1;
-   yy1 = taps->base_rect.y1 - current_rect.y1;
-   xx2 = taps->base_rect.x2 - current_rect.x2;
-   yy2 = taps->base_rect.y2 - current_rect.y2;
+        xx1 = taps->base_rect.x1 - current_rect.x1;
+        yy1 = taps->base_rect.y1 - current_rect.y1;
+        xx2 = taps->base_rect.x2 - current_rect.x2;
+        yy2 = taps->base_rect.y2 - current_rect.y2;
 
-   if (ABS(xx1) > conf->tap.moving_range ||
-       ABS(yy1) > conf->tap.moving_range ||
-       ABS(xx2) > conf->tap.moving_range ||
-       ABS(yy2) > conf->tap.moving_range)
-     {
-        GTWRN("%d finger moving too large diff: (%d, %d)(%d, %d)\n", ev->multi.device, xx1, yy1, xx2, yy2);
-        _e_gesture_tap_cancel();
+        if (ABS(xx1) > conf->tap.moving_range ||
+            ABS(yy1) > conf->tap.moving_range ||
+            ABS(xx2) > conf->tap.moving_range ||
+            ABS(yy2) > conf->tap.moving_range)
+          {
+             GTWRN("Tap Move. (id:%d) moving too large (%d, %d)(%d, %d) range:%d\n", ev->multi.device, xx1, yy1, xx2, yy2, conf->tap.moving_range);
+             _e_gesture_tap_cancel();
+          }
      }
 }