conf = gconfig->conf;
+ if (!conf->within_distance) conf->within_distance = E_GESTURE_WITHIN_DISTANCE;
_e_gesture_conf_edge_swipe_check(conf);
_e_gesture_conf_edge_drag_check(conf);
_e_gesture_conf_tap_check(conf);
#define D gconfig->conf_edd
E_CONFIG_VAL(D, T, key_device_name, STR);
E_CONFIG_VAL(D, T, event_keep, CHAR);
+ E_CONFIG_VAL(D, T, within_distance, INT);
E_CONFIG_VAL(D, T, edge_swipe.time_done, DOUBLE);
E_CONFIG_VAL(D, T, edge_swipe.time_begin, DOUBLE);
_e_gesture_event_flush();
}
+static Eina_Bool
+_e_gesture_process_distance_check(int id, int x, int y)
+{
+ double distance;
+ int cx = 0, cy = 0;
+ E_Gesture_Conf_Edd *conf = gesture->config->conf;
+
+ _e_gesture_util_center_axis_get(gesture->gesture_events.num_pressed, &cx, &cy);
+ distance = _e_gesture_util_distance_get(x, y, cx, cy);
+
+ // for Debugging
+ GTDBG("Touch. id:%d, (%d, %d) center(%d, %d), distance: %lf", id, x, y, cx, cy, distance);
+ if (distance > (double)conf->within_distance)
+ {
+ GTWRN("distance(%.2f) is too far. (conf.within_distance:%d) ", distance, conf->within_distance);
+ return EINA_FALSE;
+ }
+ return EINA_TRUE;
+}
static void
_e_gesture_pan_send(int mode, int fingers, int cx, int cy, struct wl_resource *res, struct wl_client *client)
return ECORE_CALLBACK_CANCEL;
}
-static void
-_e_gesture_process_pan_down(Ecore_Event_Mouse_Button *ev)
+static Eina_Bool
+_e_gesture_pan_condition_check(E_Gesture_Event_Pan *pans)
{
- E_Gesture_Event_Pan *pans = &gesture->gesture_events.pans;
-
if (!pans->activation.active)
{
_e_gesture_pan_cancel();
- return;
+ return EINA_FALSE;
}
if (gesture->gesture_events.recognized_gesture &&
(gesture->gesture_events.recognized_gesture & E_GESTURE_TYPE_PINCH)))
_e_gesture_pan_cancel();
+ return EINA_TRUE;
+}
+
+static void
+_e_gesture_process_pan_down(Ecore_Event_Mouse_Button *ev)
+{
+ E_Gesture_Event_Pan *pans = &gesture->gesture_events.pans;
+
+ if (!_e_gesture_pan_condition_check(pans))
+ {
+ return;
+ }
+
+ if (gesture->gesture_events.num_pressed > 0)
+ {
+ if (!_e_gesture_process_distance_check(ev->multi.device,
+ ev->x, ev->y))
+ _e_gesture_pan_cancel();
+ }
+
if (gesture->gesture_events.num_pressed == 1)
{
pans->state = E_GESTURE_PANPINCH_STATE_READY;
Coords cur_point = {0,};
int idx, diff_x, diff_y, mode;
- if (!pans->activation.active)
+ if (!_e_gesture_pan_condition_check(pans))
{
- _e_gesture_pan_cancel();
return;
}
- if (gesture->gesture_events.recognized_gesture &&
- !((gesture->gesture_events.recognized_gesture & E_GESTURE_TYPE_PAN) ||
- (gesture->gesture_events.recognized_gesture & E_GESTURE_TYPE_PINCH)))
- _e_gesture_pan_cancel();
+ if (gesture->gesture_events.num_pressed > 0)
+ {
+ if (!_e_gesture_process_distance_check(ev->multi.device,
+ ev->x, ev->y))
+ _e_gesture_pan_cancel();
+ }
idx = gesture->gesture_events.num_pressed;
if (idx <= 0) return;
return;
}
+ if (gesture->gesture_events.num_pressed > 0)
+ {
+ if (!_e_gesture_process_distance_check(ev->multi.device,
+ ev->x, ev->y))
+ _e_gesture_tap_cancel();
+ }
+
if (taps->enabled_finger < gesture->gesture_events.num_pressed)
taps->enabled_finger = gesture->gesture_events.num_pressed;
return;
}
+ if (gesture->gesture_events.num_pressed > 0)
+ {
+ if (!_e_gesture_process_distance_check(ev->multi.device,
+ ev->x, ev->y))
+ _e_gesture_tap_cancel();
+ }
+
_e_gesture_util_rect_get(taps->enabled_finger, ¤t_rect.x1, ¤t_rect.y1, ¤t_rect.x2, ¤t_rect.y2);
xx1 = taps->base_rect.x1 - current_rect.x1;
ABS(xx2) > conf->tap.moving_range ||
ABS(yy2) > conf->tap.moving_range)
{
- GTDBG("%d finger moving too large diff: (%d, %d)(%d, %d)\n", ev->multi.device, xx1, yy1, xx2, yy2);
+ GTWRN("%d finger moving too large diff: (%d, %d)(%d, %d)\n", ev->multi.device, xx1, yy1, xx2, yy2);
_e_gesture_tap_cancel();
}
}