From 8884a2864c02b3dc8b37e97e265410dcd7bce516 Mon Sep 17 00:00:00 2001 From: Lukasz Wlazly Date: Tue, 16 Oct 2018 15:48:11 +0200 Subject: [PATCH] [Fix] touch event unpair issue This patch resolve issue when ECORE_EVENT_MOUSE_BUTTON_UP doesn't come to other registered ecore event filters Change-Id: I7c8a763d0eafb524e218293440458bd1ed2746ec --- src/e_screen_reader_gestures.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/e_screen_reader_gestures.c b/src/e_screen_reader_gestures.c index 842828d..d2444a0 100644 --- a/src/e_screen_reader_gestures.c +++ b/src/e_screen_reader_gestures.c @@ -89,6 +89,8 @@ struct _Cover int drag_x_delta; int drag_y_delta; } tap_n_hold_gesture_data; + + Ecore_Timer *up_timer; }; typedef struct _Cover Cover; @@ -1380,6 +1382,15 @@ _mouse_move(int type, Ecore_Event_Mouse_Move *event) } static Eina_Bool +_on_up_timeout(void *data) +{ + Ecore_Event_Mouse_Button *ev_up = data; + ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev_up, NULL, NULL); + cover->up_timer = NULL; + return EINA_FALSE; +} + +static Eina_Bool _mouse_button_up(int type, Ecore_Event_Mouse_Button *event) { Ecore_Event_Mouse_Button *ev = event; @@ -1399,7 +1410,11 @@ _mouse_button_up(int type, Ecore_Event_Mouse_Button *event) } memcpy(ev_up, ev, sizeof(Ecore_Event_Mouse_Button)); ev_up->multi.radius += MAGIC_NUMBER; - ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev_up, NULL, NULL); + + if (cover->up_timer) + ecore_timer_del(cover->up_timer); + cover->up_timer = ecore_timer_add(0, _on_up_timeout, ev_up); + cover->tap_n_hold_gesture_data.drag_start = EINA_FALSE; highlighted_object_x = -1; highlighted_object_y = -1; @@ -1516,6 +1531,7 @@ _gesture_init() { ERROR("Fail to find zone"); } + cover->up_timer = NULL; } static void @@ -1525,6 +1541,9 @@ _gesture_shutdown(void) ecore_timer_del(cover->tap_gesture_data.timer); if (cover->hover_gesture.timer) ecore_timer_del(cover->hover_gesture.timer); + if (cover->up_timer) + ecore_timer_del(cover->up_timer); + cover->up_timer = NULL; free(cover); } -- 2.7.4