bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bf0fe4a800696924fe94facea5983f3cfa1e2b60
commit bf0fe4a800696924fe94facea5983f3cfa1e2b60 Author: Mike Blumenkrantz <[email protected]> Date: Thu Jan 23 15:18:58 2020 -0500 efl/gesture: add 'pressed' state info for touch data since we retain touch info for the duration of a touch sequence, including after a touch point has been unpressed, it's necessary to track the current state of each point and then use that to accurately determine the number of touches active Reviewed-by: woochan lee <[email protected]> Differential Revision: https://phab.enlightenment.org/D11168 --- src/lib/evas/gesture/efl_canvas_gesture_touch.c | 9 +++++++-- src/lib/evas/gesture/efl_canvas_gesture_types.eot | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/gesture/efl_canvas_gesture_touch.c b/src/lib/evas/gesture/efl_canvas_gesture_touch.c index 3e90b7d751..d621b3be4a 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_touch.c +++ b/src/lib/evas/gesture/efl_canvas_gesture_touch.c @@ -56,14 +56,16 @@ _efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_T if (action == EFL_POINTER_ACTION_DOWN) { - pd->touch_down++; + if ((!point) || (!point->cur.pressed)) + pd->touch_down++; if (pd->touch_down >= 2) pd->multi_touch = EINA_TRUE; } else if ((action == EFL_POINTER_ACTION_UP) || (action == EFL_POINTER_ACTION_CANCEL)) { - pd->touch_down--; + if (point && point->cur.pressed) + pd->touch_down--; if (pd->multi_touch && pd->touch_down == 1) pd->multi_touch = EINA_FALSE; } @@ -100,16 +102,19 @@ _efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_T if (!id && (action == EFL_POINTER_ACTION_DOWN)) { + point->cur.pressed = EINA_TRUE; pd->state = EFL_GESTURE_TOUCH_STATE_BEGIN; } else if (action == EFL_POINTER_ACTION_UP) { + point->cur.pressed = EINA_FALSE; pd->state = EFL_GESTURE_TOUCH_STATE_END; } else { pd->state = EFL_GESTURE_TOUCH_STATE_UPDATE; } + point->cur.pressed |= action == EFL_POINTER_ACTION_DOWN || action == EFL_POINTER_ACTION_MOVE; return; finished_touch: diff --git a/src/lib/evas/gesture/efl_canvas_gesture_types.eot b/src/lib/evas/gesture/efl_canvas_gesture_types.eot index 600518b31c..ad3ebd7c64 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_types.eot +++ b/src/lib/evas/gesture/efl_canvas_gesture_types.eot @@ -51,6 +51,7 @@ enum @beta Efl.Canvas.Gesture_Recognizer_Type struct @beta @c_name(Efl_Gesture_Touch_Point_Info) Efl.Canvas.Gesture_Touch_Point_Info { [[This struct represents the underlying data of a touch point.]] pos: Eina.Position2D; [[The canvas position of the touch point data.]] + pressed: bool; [[Whether this touch point is being pressed down.]] timestamp: uint; [[The timestamp of the touch point data.]] } --
