evas: fix logic in evas_events.c
authorJaeun Choi <jaeun12.choi@samsung.com>
Wed, 26 Apr 2017 08:16:16 +0000 (17:16 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 26 Apr 2017 09:42:49 +0000 (18:42 +0900)
Summary:
when collecting the objects under a mouse pointer,
evas uses the geometry of an object to decide
whether the mouse pointer is inside the area of the object,
which is inappropriate for a mapped object.
so mapped objects don't receive mouse events when they should.
this patch fixes the issue.

Test Plan: A sample code will be added as comments

Reviewers: jpeg, raster

Subscribers: cedric, eunue

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

src/lib/evas/canvas/evas_events.c

index cfaee6e..dcb318d 100644 (file)
@@ -142,18 +142,25 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
         // for plan b and doing this on the fly. it's only for event or
         // callback handling so its a small percentage of the time, but
         // it's better that we get this right
-        if (obj->is_smart)
-          {
-             Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 };
 
-             evas_object_smart_bounding_box_update(obj);
-             evas_object_smart_bounding_box_get(obj, &bounding_box, NULL);
-             c = bounding_box;
-          }
+        if (EINA_UNLIKELY((!!obj->map) && (obj->map->cur.map)
+                          && (obj->map->cur.usemap)))
+          c = obj->map->cur.map->normal_geometry;
         else
           {
-             if (obj->clip.clipees) continue;
-             c = obj->cur->geometry;
+             if (obj->is_smart)
+               {
+                  Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 };
+
+                  evas_object_smart_bounding_box_update(obj);
+                  evas_object_smart_bounding_box_get(obj, &bounding_box, NULL);
+                  c = bounding_box;
+               }
+             else
+               {
+                  if (obj->clip.clipees) continue;
+                  c = obj->cur->geometry;
+               }
           }
         clip_calc(obj->cur->clipper, &c);
         // only worry about objects that intersect INCLUDING clippint