From a6280661f1c0446faa920d766f0d2f85eb69de13 Mon Sep 17 00:00:00 2001 From: Aharon Hillel Date: Mon, 7 Nov 2011 14:31:20 +0000 Subject: [PATCH] Elm glayer: Fixed bug in N tap testing Signed-off-by: Aharon Hillel SVN revision: 64867 --- legacy/elementary/src/lib/elm_gesture_layer.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/legacy/elementary/src/lib/elm_gesture_layer.c b/legacy/elementary/src/lib/elm_gesture_layer.c index 2362d2657c..aaab193b2d 100644 --- a/legacy/elementary/src/lib/elm_gesture_layer.c +++ b/legacy/elementary/src/lib/elm_gesture_layer.c @@ -1093,8 +1093,8 @@ compare_match_fingers(const void *data1, const void *data2) static int compare_pe_device(const void *data1, const void *data2) -{ /* Compare coords of first item in list to cur coords */ - const Pointer_Event *pe1 = eina_list_data_get(eina_list_last(data1)); +{ /* Compare device of first item in list to our pe device */ + const Pointer_Event *pe1 = eina_list_data_get(data1); const Pointer_Event *pe2 = data2; /* Only match if last was a down event */ @@ -1263,7 +1263,19 @@ _tap_gesture_start(Widget_Data *wd, Pointer_Event *pe, { case EVAS_CALLBACK_MULTI_DOWN: case EVAS_CALLBACK_MOUSE_DOWN: + /* Check if got tap on same cord was tapped before */ pe_list = eina_list_search_unsorted(st->l, compare_match_fingers, pe); + + if ((!pe_list) && + eina_list_search_unsorted(st->l, compare_pe_device, pe)) + { /* This device was touched in other cord before completion */ + ev_flag = _set_state(gesture, ELM_GESTURE_STATE_ABORT, + &st->info, EINA_FALSE); + consume_event(wd, event_info, event_type, ev_flag); + + return EINA_FALSE; + } + pe_list = _record_pointer_event(st, pe_list, pe, wd, event_info, event_type); if ((pe->device == 0) && (eina_list_count(pe_list) == 1)) { /* This is the first mouse down we got */ @@ -2325,7 +2337,6 @@ get_finger_gap_length(Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, * * @ingroup Elm_Gesture_Layer */ -/* FIXME change float to double */ static double compute_zoom(Zoom_Type *st, Evas_Coord x1, Evas_Coord y1, unsigned int tm1, Evas_Coord x2, Evas_Coord y2, unsigned int tm2, double zoom_finger_factor)