cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=371eb00ecb2243451e2e6544f0faf10d017c1073
commit 371eb00ecb2243451e2e6544f0faf10d017c1073 Author: woochan lee <[email protected]> Date: Thu Oct 8 12:35:07 2015 +0200 gesture_layer: fix long tap gesture has wrong timestamp. Summary: The timestamp has 0 value when n_long_tap_start callback called. Then timestamp is same on each n_long_tap_move callback functions. For fix this bug, update timestamp before called state_set function. Also update timestamp in every timeout. Test Plan: Run test_gesture_layer2.c Print timestamp in every n_long_tap_XXX callback. Reviewers: tasn, cedric Differential Revision: https://phab.enlightenment.org/D3144 Signed-off-by: Cedric BAIL <[email protected]> --- src/lib/elm_gesture_layer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/elm_gesture_layer.c b/src/lib/elm_gesture_layer.c index 48f5285..7a37ae3 100644 --- a/src/lib/elm_gesture_layer.c +++ b/src/lib/elm_gesture_layer.c @@ -1781,6 +1781,9 @@ static Eina_Bool _long_tap_timeout(void *data) { Gesture_Info *gesture = data; + Long_Tap_Type *st = gesture->data; + + st->info.timestamp = ecore_time_get() * 1000; _state_set(gesture, ELM_GESTURE_STATE_MOVE, gesture->data, EINA_TRUE); @@ -2109,13 +2112,13 @@ _n_long_tap_test(Evas_Object *obj, _compute_taps_center(st, &st->info.x, &st->info.y, pe); st->center_x = st->info.x; /* Update coords for */ st->center_y = st->info.y; /* reporting START */ + st->info.timestamp = pe->timestamp; /* This is the first mouse down we got */ if (eina_list_count(st->touched) == 1) { _state_set(gesture, ELM_GESTURE_STATE_START, gesture->data, EINA_FALSE); - st->info.timestamp = pe->timestamp; /* To test long tap */ /* When this timer expires, gesture STARTED */ @@ -2135,6 +2138,7 @@ _n_long_tap_test(Evas_Object *obj, case EVAS_CALLBACK_MOUSE_UP: st->touched = _touched_device_remove(st->touched, pe); _compute_taps_center(st, &st->center_x, &st->center_y, pe); + st->info.timestamp = pe->timestamp; if (st->info.n) { if (gesture->state == ELM_GESTURE_STATE_MOVE) @@ -2161,6 +2165,7 @@ _n_long_tap_test(Evas_Object *obj, Evas_Coord y = 0; _compute_taps_center(st, &x, &y, pe); + st->info.timestamp = pe->timestamp; /* ABORT if user moved fingers out of tap area */ if (!_inside(x, y, st->center_x, st->center_y, sd->tap_finger_size)) --
