summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwoochan lee <wc0917.lee@samsung.com>2015-10-08 12:35:07 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-10-24 04:05:24 +0200
commit371eb00ecb2243451e2e6544f0faf10d017c1073 (patch)
tree0f7ced2cfe2339a7162a3b202dbee4f1750c1c2d
parent10e425eb104e160a49a3a47700ac82b82a663890 (diff)
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 <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_gesture_layer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/elm_gesture_layer.c b/src/lib/elm_gesture_layer.c
index 48f528553..7a37ae36d 100644
--- a/src/lib/elm_gesture_layer.c
+++ b/src/lib/elm_gesture_layer.c
@@ -1781,6 +1781,9 @@ static Eina_Bool
1781_long_tap_timeout(void *data) 1781_long_tap_timeout(void *data)
1782{ 1782{
1783 Gesture_Info *gesture = data; 1783 Gesture_Info *gesture = data;
1784 Long_Tap_Type *st = gesture->data;
1785
1786 st->info.timestamp = ecore_time_get() * 1000;
1784 1787
1785 _state_set(gesture, ELM_GESTURE_STATE_MOVE, 1788 _state_set(gesture, ELM_GESTURE_STATE_MOVE,
1786 gesture->data, EINA_TRUE); 1789 gesture->data, EINA_TRUE);
@@ -2109,13 +2112,13 @@ _n_long_tap_test(Evas_Object *obj,
2109 _compute_taps_center(st, &st->info.x, &st->info.y, pe); 2112 _compute_taps_center(st, &st->info.x, &st->info.y, pe);
2110 st->center_x = st->info.x; /* Update coords for */ 2113 st->center_x = st->info.x; /* Update coords for */
2111 st->center_y = st->info.y; /* reporting START */ 2114 st->center_y = st->info.y; /* reporting START */
2115 st->info.timestamp = pe->timestamp;
2112 2116
2113 /* This is the first mouse down we got */ 2117 /* This is the first mouse down we got */
2114 if (eina_list_count(st->touched) == 1) 2118 if (eina_list_count(st->touched) == 1)
2115 { 2119 {
2116 _state_set(gesture, ELM_GESTURE_STATE_START, 2120 _state_set(gesture, ELM_GESTURE_STATE_START,
2117 gesture->data, EINA_FALSE); 2121 gesture->data, EINA_FALSE);
2118 st->info.timestamp = pe->timestamp;
2119 2122
2120 /* To test long tap */ 2123 /* To test long tap */
2121 /* When this timer expires, gesture STARTED */ 2124 /* When this timer expires, gesture STARTED */
@@ -2135,6 +2138,7 @@ _n_long_tap_test(Evas_Object *obj,
2135 case EVAS_CALLBACK_MOUSE_UP: 2138 case EVAS_CALLBACK_MOUSE_UP:
2136 st->touched = _touched_device_remove(st->touched, pe); 2139 st->touched = _touched_device_remove(st->touched, pe);
2137 _compute_taps_center(st, &st->center_x, &st->center_y, pe); 2140 _compute_taps_center(st, &st->center_x, &st->center_y, pe);
2141 st->info.timestamp = pe->timestamp;
2138 if (st->info.n) 2142 if (st->info.n)
2139 { 2143 {
2140 if (gesture->state == ELM_GESTURE_STATE_MOVE) 2144 if (gesture->state == ELM_GESTURE_STATE_MOVE)
@@ -2161,6 +2165,7 @@ _n_long_tap_test(Evas_Object *obj,
2161 Evas_Coord y = 0; 2165 Evas_Coord y = 0;
2162 2166
2163 _compute_taps_center(st, &x, &y, pe); 2167 _compute_taps_center(st, &x, &y, pe);
2168 st->info.timestamp = pe->timestamp;
2164 /* ABORT if user moved fingers out of tap area */ 2169 /* ABORT if user moved fingers out of tap area */
2165 if (!_inside(x, y, st->center_x, st->center_y, 2170 if (!_inside(x, y, st->center_x, st->center_y,
2166 sd->tap_finger_size)) 2171 sd->tap_finger_size))