elm_map: block longpressed event when scrolled, zoomed, or rotated
authorSung-Taek Hong <sth253.hong@samsung.com>
Mon, 19 Oct 2015 18:42:35 +0000 (11:42 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 19 Oct 2015 18:55:30 +0000 (11:55 -0700)
Summary:
Currently, longpressed event can be called when map is
scrolled, zoomed or rotated. This might cause unintentional
result, because mouse need to be down at lease once to
execute scroll, zoom, or rotate, and longpressed event will start
when those events takes long enough time.

Reviewers: seoz, Hermet, woohyun, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D3195

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/elm_map.c

index 064652a986212c7d35688650c34f3b1d6de2ff66..b2092bd5961bdd9c1768874c7d22d6eb8c6995c9 100644 (file)
@@ -1289,6 +1289,7 @@ _scroll_cb(Evas_Object *obj,
    else
       eo_do(sd->obj, eo_event_callback_call
         (EVAS_SCROLLABLE_INTERFACE_EVENT_SCROLL_DRAG_START, NULL));
+   ELM_SAFE_FREE(sd->long_timer, ecore_timer_del);
    sd->scr_timer = ecore_timer_add(0.25, _scr_timeout_cb, obj);
    eo_do(sd->obj, eo_event_callback_call
      (EVAS_SCROLLABLE_INTERFACE_EVENT_SCROLL, NULL));
@@ -3295,6 +3296,7 @@ _pinch_zoom_start_cb(void *data,
    EINA_SAFETY_ON_NULL_RETURN_VAL(data, EVAS_EVENT_FLAG_NONE);
 
    sd->pinch_zoom = sd->zoom_detail;
+   ELM_SAFE_FREE(sd->long_timer, ecore_timer_del);
 
    return EVAS_EVENT_FLAG_NONE;
 }
@@ -3338,6 +3340,7 @@ _pinch_rotate_cb(void *data,
 
         evas_object_smart_changed(sd->pan_obj);
      }
+   ELM_SAFE_FREE(sd->long_timer, ecore_timer_del);
 
    return EVAS_EVENT_FLAG_NONE;
 }