[Fix] touch event unpair issue 04/191404/1 accepted/tizen/unified/20181127.073239 submit/tizen/20181108.080505 submit/tizen/20181109.041614 submit/tizen/20181121.085850
authorLukasz Wlazly <l.wlazly@partner.samsung.com>
Tue, 16 Oct 2018 13:48:11 +0000 (15:48 +0200)
committerLukasz Wlazly <l.wlazly@partner.samsung.com>
Tue, 16 Oct 2018 13:48:11 +0000 (15:48 +0200)
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

index 842828d..d2444a0 100644 (file)
@@ -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);
 }