raster pushed a commit to branch efl-1.17.

http://git.enlightenment.org/core/efl.git/commit/?id=aebf967bc2976aca4b2c8523db2460188a075d9b

commit aebf967bc2976aca4b2c8523db2460188a075d9b
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Tue Jul 5 22:38:02 2016 +0900

    evas event handling2 - fix incorrect object reporting
    
    this fixes a new bug brought up by
    9f0fd66ab818d212fa88faef316ac17625f1a2f5 which fixes event reporting
    etc. etc. .. this fixes T4017
    
    @fix
---
 src/lib/evas/canvas/evas_events.c       | 70 ++++++++++++++++++++++++++++++---
 src/lib/evas/canvas/evas_object_smart.c |  2 +
 src/lib/evas/include/evas_inline.x      | 22 +++++++++--
 3 files changed, 84 insertions(+), 10 deletions(-)

diff --git a/src/lib/evas/canvas/evas_events.c 
b/src/lib/evas/canvas/evas_events.c
index 0300cfe..9775b25 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -32,6 +32,15 @@ _evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, 
Evas_Object_Protecte
      }
 }
 
+#if 0
+# define DDD_DO 1
+# define DDD(...) do { for (i = 0; i < spaces; i++) printf(" "); 
printf(__VA_ARGS__); } while (0)
+# define D(...) do { printf(__VA_ARGS__); } while (0)
+#else
+# define DDD(...) do { } while (0)
+# define D(...) do { } while (0)
+#endif
+
 static Eina_List *
 _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
                                    const Eina_Inlist *list, Evas_Object *stop,
@@ -41,7 +50,15 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
    Evas_Object_Protected_Data *obj = NULL;
    int inside;
 
+#ifdef DDD_DO
+   static int spaces = 0;
+   int i;
+#endif
+
    if (!list) return in;
+#ifdef DDD_DO
+   spaces++;
+#endif
    for (obj = _EINA_INLIST_CONTAINER(obj, eina_inlist_last(list));
         obj;
         obj = _EINA_INLIST_CONTAINER(obj, EINA_INLIST_GET(obj)->prev))
@@ -50,16 +67,39 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List 
*in,
         if (eo_obj == stop)
           {
              *no_rep = 1;
+#ifdef DDD_DO
+             spaces--;
+#endif
+             DDD("***** NO REP - STOP *****\n");
              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;
+                              obj->cur->cache.clip.x,
+                              obj->cur->cache.clip.y,
+                              obj->cur->cache.clip.w,
+                              obj->cur->cache.clip.h)))
+          {
+             DDD("___  %p g[%6i %6i %6ix%6i] c[%6i %6i %6ix%6i] %s\n",
+                 obj->object,
+                 obj->cur->geometry.x, obj->cur->geometry.y,
+                 obj->cur->geometry.w, obj->cur->geometry.h,
+                 obj->cur->cache.clip.x, obj->cur->cache.clip.y,
+                 obj->cur->cache.clip.w, obj->cur->cache.clip.h,
+                 obj->type);
+             continue;
+          }
+        else
+          {
+             DDD("OBJ  %p g[%6i %6i %6ix%6i] c[%6i %6i %6ix%6i] %s\n",
+                 obj->object,
+                 obj->cur->geometry.x, obj->cur->geometry.y,
+                 obj->cur->geometry.w, obj->cur->geometry.h,
+                 obj->cur->cache.clip.x, obj->cur->cache.clip.y,
+                 obj->cur->cache.clip.w, obj->cur->cache.clip.h,
+                 obj->type);
+          }
 
         if (!source)
           {
@@ -72,6 +112,7 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
           {
              if (obj->is_smart)
                {
+                  DDD("CHILDREN ->\n");
                   Evas_Object_Protected_Data *clip = obj->cur->clipper;
                   int norep = 0;
 
@@ -130,6 +171,10 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List 
*in,
                        if (!obj->repeat_events)
                          {
                             *no_rep = 1;
+#ifdef DDD_DO
+                            spaces--;
+#endif
+                            DDD("***** NO REP1 *****\n");
                             return in;
                          }
                     }
@@ -159,10 +204,17 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List 
*in,
                                  (evas_object_is_inside(eo_obj, obj, x, y))))
                     {
                        if (!evas_event_freezes_through(eo_obj, obj))
-                         in = eina_list_append(in, eo_obj);
+                         {
+                            DDD("----------------> ADD obj %p\n", obj->object);
+                            in = eina_list_append(in, eo_obj);
+                         }
                        if (!obj->repeat_events)
                          {
                             *no_rep = 1;
+#ifdef DDD_DO
+                            spaces--;
+#endif
+                            DDD("***** NO REP2 *****\n");
                             return in;
                          }
                     }
@@ -170,6 +222,9 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List 
*in,
           }
      }
    *no_rep = 0;
+#ifdef DDD_DO
+   spaces--;
+#endif
    return in;
 }
 
@@ -884,9 +939,11 @@ _evas_event_objects_event_list_no_frozen_check(Evas *eo_e, 
Evas_Object *stop, in
 
    if (!e->layers) return NULL;
 
+   D("@@@@@ layer count = %i\n", 
eina_inlist_count(EINA_INLIST_GET(e->layers)));
    EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
      {
         int no_rep = 0;
+        D("############################# check layer %i\n", lay->layer);
         in = _evas_event_object_list_in_get(eo_e, in,
                                             EINA_INLIST_GET(lay->objects),
                                             stop, x, y, &no_rep, EINA_FALSE);
@@ -907,6 +964,7 @@ evas_event_objects_event_list(Evas *eo_e, Evas_Object 
*stop, int x, int y)
    Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
 
    if ((!e->layers) || (e->is_frozen)) return NULL;
+   D("------------------------------GET EVETNS AT ............... %i %i\n", x, 
y); 
    return _evas_event_objects_event_list_no_frozen_check(eo_e, stop, x, y);
 }
 
diff --git a/src/lib/evas/canvas/evas_object_smart.c 
b/src/lib/evas/canvas/evas_object_smart.c
index edc8d3e..ea6e39b 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -1363,6 +1363,8 @@ evas_object_smart_bounding_box_update(Evas_Object 
*eo_obj, Evas_Object_Protected
 
    if (!os->update_boundingbox_needed) return;
    os->update_boundingbox_needed = EINA_FALSE;
+   evas_object_clip_dirty(eo_obj, obj);
+   if (obj->cur->clipper) evas_object_clip_recalc(obj->cur->clipper);
 
    minx = obj->layer->evas->output.w;
    miny = obj->layer->evas->output.h;
diff --git a/src/lib/evas/include/evas_inline.x 
b/src/lib/evas/include/evas_inline.x
index cf28ed7..2a38d06 100644
--- a/src/lib/evas/include/evas_inline.x
+++ b/src/lib/evas/include/evas_inline.x
@@ -277,10 +277,24 @@ evas_object_clip_recalc(Evas_Object_Protected_Data *obj)
      }
    else
      {
-        cx = obj->cur->geometry.x;
-        cy = obj->cur->geometry.y;
-        cw = obj->cur->geometry.w;
-        ch = obj->cur->geometry.h;
+        if (obj->is_smart)
+          {
+             Evas_Coord_Rectangle bounding_box = { 0, 0, 0, 0 };
+
+             evas_object_smart_bounding_box_update(eo_obj, obj);
+             evas_object_smart_bounding_box_get(eo_obj, &bounding_box, NULL);
+             cx = bounding_box.x;
+             cy = bounding_box.y;
+             cw = bounding_box.w;
+             ch = bounding_box.h;
+          }
+        else
+          {
+             cx = obj->cur->geometry.x;
+             cy = obj->cur->geometry.y;
+             cw = obj->cur->geometry.w;
+             ch = obj->cur->geometry.h;
+          }
      }
 
    if (obj->cur->color.a == 0 && obj->cur->render_op == EVAS_RENDER_BLEND)

-- 


Reply via email to