diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2020-01-22 13:48:39 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2020-01-23 15:25:36 -0500 |
commit | 6efbd83536d30216d8c1edfa00dac195e604e674 (patch) | |
tree | d356e1b5c699292c0b7a8d06ddb26f54ee62a076 | |
parent | 1671b4573d56b39169eaa051a83edf8c366b069e (diff) | |
download | efl-6efbd83536d30216d8c1edfa00dac195e604e674.tar.gz |
evas/events: fix multi-touch object targeting on touch down events
a touch press is both a touch and a move event, which means the canvas must
update its list of target objects on the first touch press to avoid using the
wrong objects when processing events
@fix
Differential Revision: https://phab.enlightenment.org/D11163
-rw-r--r-- | src/lib/evas/canvas/evas_events.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 12b38f1621..2b86b0e674 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -1037,7 +1037,35 @@ _evas_event_source_multi_down_events(Evas_Object_Protected_Data *obj, Evas_Publi if (pdata->seat->mouse_grabbed == 0) { - if (pdata->seat->downs > 1) addgrab = pdata->seat->downs - 1; + if (pdata->seat->downs > 1) + addgrab = pdata->seat->downs - 1; + else /* this is the first touch, which means it's also a move event, which means we need to redo this */ + { + Eina_List *ins = NULL; + + if (src->is_smart) + { + int no_rep = 0; + ins = _evas_event_object_list_raw_in_get + (e->evas, ins, evas_object_smart_members_get_direct(eo_src), NULL, NULL, + ev->cur.x, ev->cur.y, &no_rep, EINA_TRUE, EINA_FALSE); + } + if (src->is_event_parent) + { + int no_rep = 0; + ins = _evas_event_object_list_raw_in_get + (e->evas, ins, NULL, evas_object_event_grabber_members_list(eo_src), NULL, + ev->cur.x, ev->cur.y, &no_rep, EINA_TRUE, EINA_FALSE); + } + else + ins = eina_list_append(ins, eo_src); + EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, src->proxy, Evas_Object_Proxy_Data, proxy_write) + { + eina_list_free(proxy_write->src_event_in); + proxy_write->src_event_in = ins; + } + EINA_COW_WRITE_END(evas_object_proxy_cow, src->proxy, proxy_write); + } } EINA_LIST_FOREACH(src->proxy->src_event_in, l, eo_child) @@ -3006,7 +3034,17 @@ _canvas_event_feed_multi_down_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _evas_touch_point_append(eo_e, ev->touch_id, ev->cur.x, ev->cur.y); if (pdata->seat->mouse_grabbed == 0) { - if (pdata->seat->downs > 1) addgrab = pdata->seat->downs - 1; + if (pdata->seat->downs > 1) + addgrab = pdata->seat->downs - 1; + else /* this is the first touch, which means it's also a move event, which means we need to redo this */ + { + /* get all new in objects */ + Eina_List *ins = evas_event_objects_event_list(eo_e, NULL, ev->cur.x, ev->cur.y); + /* free our old list of ins */ + eina_list_free(pdata->seat->object.in); + /* and set up the new one */ + pdata->seat->object.in = ins; + } } copy = evas_event_list_copy(pdata->seat->object.in); EINA_LIST_FOREACH(copy, l, eo_obj) |