diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-07-05 15:40:12 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-07-07 16:06:44 +0900 |
commit | 30d98fa1bd3be621897d6240f26801b2a53c427d (patch) | |
tree | d59aaf8e7cc9579f99fc6b020cccab94ef12b00b | |
parent | ab4c247f9ef8b32c85626d9397c1d3619ced66ab (diff) | |
download | efl-30d98fa1bd3be621897d6240f26801b2a53c427d.tar.gz |
evas event handling - fix incorrect object reporting
this fixes event reporting for mouse in/out/move/down/up due to evas
just totally getting tese objects wrong.
this fixes T3718
@fix
-rw-r--r-- | src/lib/evas/canvas/evas_events.c | 12 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_smart.c | 58 |
2 files changed, 39 insertions, 31 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 0ef5e919e0..0300cfe415 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -42,7 +42,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, int inside; if (!list) return in; - for (obj = _EINA_INLIST_CONTAINER(obj, list); + for (obj = _EINA_INLIST_CONTAINER(obj, eina_inlist_last(list)); obj; obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev)) { @@ -52,6 +52,15 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in, *no_rep = 1; return in; } + + evas_object_clip_recalc(obj); + if ((!RECTS_INTERSECT(x, y, 1, 1, + obj->cur->cache.clip.x, + obj->cur->cache.clip.y, + obj->cur->cache.clip.w, + obj->cur->cache.clip.h))) + continue; + if (!source) { if (evas_event_passes_through(eo_obj, obj)) continue; @@ -862,7 +871,6 @@ _evas_event_object_list_in_get(Evas *eo_e, Eina_List *in, const Eina_Inlist *list, Evas_Object *stop, int x, int y, int *no_rep, Eina_Bool source) { - if (!list) return NULL; return _evas_event_object_list_raw_in_get(eo_e, in, list->last, stop, x, y, no_rep, source); } diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 486811403b..edc8d3efb8 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c @@ -1124,13 +1124,13 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data /* Update left limit */ if (noclip && x < smart_parent->cur.bounding_box.x) { - smart_parent->cur.bounding_box.w += smart_parent->cur.bounding_box.x - x; - smart_parent->cur.bounding_box.x = x; + smart_parent->cur.bounding_box.w += smart_parent->cur.bounding_box.x - x; + smart_parent->cur.bounding_box.x = x; propagate = EINA_TRUE; } else if ((px == smart_parent->prev.bounding_box.x && - x > smart_parent->cur.bounding_box.x) + x > smart_parent->cur.bounding_box.x) || (!noclip && x == smart_parent->cur.bounding_box.x)) { computeminmax = EINA_TRUE; @@ -1145,7 +1145,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data propagate = EINA_TRUE; } else if ((py == smart_parent->prev.bounding_box.y && - y > smart_parent->cur.bounding_box.y) + y > smart_parent->cur.bounding_box.y) || (!noclip && y == smart_parent->cur.bounding_box.y)) { computeminmax = EINA_TRUE; @@ -1154,8 +1154,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data /* Update right limit */ if (noclip && x + w > smart_parent->cur.bounding_box.x + smart_parent->cur.bounding_box.w) { - smart_parent->cur.bounding_box.w = x + w - smart_parent->cur.bounding_box.x; - + smart_parent->cur.bounding_box.w = x + w - smart_parent->cur.bounding_box.x; propagate = EINA_TRUE; } else if ((px + pw == smart_parent->prev.bounding_box.x + smart_parent->prev.bounding_box.w && @@ -1168,7 +1167,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data /* Update bottom limit */ if (noclip && y + h > smart_parent->cur.bounding_box.y + smart_parent->cur.bounding_box.h) { - smart_parent->cur.bounding_box.h = y + h - smart_parent->cur.bounding_box.y; + smart_parent->cur.bounding_box.h = y + h - smart_parent->cur.bounding_box.y; propagate = EINA_TRUE; } @@ -1179,7 +1178,7 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data computeminmax = EINA_TRUE; } - if (computeminmax) + if (computeminmax) { evas_object_smart_need_bounding_box_update(obj->smart.parent); } @@ -1188,14 +1187,14 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data { if (noclip) { - smart_parent->cur.bounding_box.x = x; - smart_parent->cur.bounding_box.y = y; - smart_parent->cur.bounding_box.w = w; - smart_parent->cur.bounding_box.h = h; + smart_parent->cur.bounding_box.x = x; + smart_parent->cur.bounding_box.y = y; + smart_parent->cur.bounding_box.w = w; + smart_parent->cur.bounding_box.h = h; - EINA_COW_STATE_WRITE_BEGIN(smart_obj, smart_write, cur) - smart_write->valid_bounding_box = EINA_TRUE; - EINA_COW_STATE_WRITE_END(smart_obj, smart_write, cur); + EINA_COW_STATE_WRITE_BEGIN(smart_obj, smart_write, cur) + smart_write->valid_bounding_box = EINA_TRUE; + EINA_COW_STATE_WRITE_END(smart_obj, smart_write, cur); propagate = EINA_TRUE; } @@ -1207,17 +1206,17 @@ evas_object_update_bounding_box(Evas_Object *eo_obj, Evas_Object_Protected_Data void evas_object_smart_bounding_box_get(Evas_Object *eo_obj, - Evas_Coord_Rectangle *cur_bounding_box, - Evas_Coord_Rectangle *prev_bounding_box) + Evas_Coord_Rectangle *cur_bounding_box, + Evas_Coord_Rectangle *prev_bounding_box) { Evas_Smart_Data *s = eo_data_scope_get(eo_obj, MY_CLASS); if (cur_bounding_box) memcpy(cur_bounding_box, - &s->cur.bounding_box, - sizeof (*cur_bounding_box)); + &s->cur.bounding_box, + sizeof (*cur_bounding_box)); if (prev_bounding_box) memcpy(prev_bounding_box, - &s->prev.bounding_box, - sizeof (*prev_bounding_box)); + &s->prev.bounding_box, + sizeof (*prev_bounding_box)); } void @@ -1378,24 +1377,25 @@ evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected if (o == obj) continue ; if (o->clip.clipees || o->is_static_clip) continue ; + if (!o->cur->visible) continue; - if (o->is_smart) + if (o->is_smart) { - Evas_Smart_Data *s = eo_data_scope_get(o->object, MY_CLASS); + Evas_Smart_Data *s = eo_data_scope_get(o->object, MY_CLASS); evas_object_smart_bounding_box_update(o->object, o); tx = s->cur.bounding_box.x; ty = s->cur.bounding_box.y; - tw = s->cur.bounding_box.x + s->cur.bounding_box.w; - th = s->cur.bounding_box.y + s->cur.bounding_box.h; + tw = tx + s->cur.bounding_box.w; + th = ty + s->cur.bounding_box.h; } else { tx = o->cur->geometry.x; ty = o->cur->geometry.y; - tw = o->cur->geometry.x + o->cur->geometry.w; - th = o->cur->geometry.y + o->cur->geometry.h; + tw = tx + o->cur->geometry.w; + th = ty + o->cur->geometry.h; } if (tx < minx) minx = tx; @@ -1407,13 +1407,13 @@ evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected if (minx != os->cur.bounding_box.x) { os->cur.bounding_box.w += os->cur.bounding_box.x - minx; - os->cur.bounding_box.x = minx; + os->cur.bounding_box.x = minx; } if (miny != os->cur.bounding_box.y) { os->cur.bounding_box.h += os->cur.bounding_box.y - miny; - os->cur.bounding_box.y = miny; + os->cur.bounding_box.y = miny; } if (maxw != os->cur.bounding_box.x + os->cur.bounding_box.w) |