Elm glayer: Fixed bug of starting line,momentum with mouse-move
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 7 Nov 2011 14:31:25 +0000 (14:31 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 7 Nov 2011 14:31:25 +0000 (14:31 +0000)
Signed-off-by: Aharon Hillel <a.hillel@partner.samsung.com>
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@64868 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_gesture_layer.c

index aaab193..90a043c 100644 (file)
@@ -328,9 +328,16 @@ _add_touched_device(Eina_List *list, Pointer_Event *pe)
         return list;
      }
 
-   p = malloc(sizeof(Pointer_Event));
-   memcpy(p, pe, sizeof(Pointer_Event)); /* Freed in _remove_touched_device() */
-   return eina_list_append(list, p);
+   if ((pe->event_type == EVAS_CALLBACK_MOUSE_DOWN) ||
+         (pe->event_type == EVAS_CALLBACK_MULTI_DOWN))
+     {  /* Add touched device on DOWN event only */
+        p = malloc(sizeof(Pointer_Event));
+        /* Freed in _remove_touched_device()    */
+        memcpy(p, pe, sizeof(Pointer_Event));
+        return eina_list_append(list, p);
+     }
+
+   return list;
 }
 /* END   - Functions to manage touched-device list */
 
@@ -1709,6 +1716,9 @@ _momentum_test(Evas_Object *obj, Pointer_Event *pe,
    Gesture_Info *gesture = wd->gesture[g_type];
    if (!gesture ) return;
 
+   if (!eina_list_count(wd->touched))
+     return; /* Got move on mouse-over move */
+
    Momentum_Type *st = gesture->data;
    Elm_Gesture_State state_to_report = ELM_GESTURE_STATE_MOVE;
    if (!st)
@@ -1957,6 +1967,9 @@ _n_line_test(Evas_Object *obj, Pointer_Event *pe, void *event_info,
    Gesture_Info *gesture = wd->gesture[g_type];
    if (!gesture ) return;
 
+   if (!eina_list_count(wd->touched))
+     return; /* Got move on mouse-over move */
+
    Line_Type *st = gesture->data;
    if (!st)
      {