evas event handling2 - fix incorrect object reporting
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 5 Jul 2016 13:38:02 +0000 (22:38 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 5 Jul 2016 13:40:51 +0000 (22:40 +0900)
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
src/lib/evas/canvas/evas_object_smart.c
src/lib/evas/include/evas_inline.x

index 6d4f24a..e94321d 100644 (file)
@@ -134,6 +134,15 @@ _efl_event_desc_get(Evas_Callback_Type type)
 #define EV_RESET(a) do { if (a) efl_event_reset(a); } while (0)
 #define EV_DEL(a) do { if (a) { eo_unref(a); } a = NULL; } while (0)
 
+#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,
@@ -143,7 +152,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))
@@ -152,16 +169,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)
           {
@@ -174,6 +214,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;
 
@@ -232,6 +273,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;
                          }
                     }
@@ -261,10 +306,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;
                          }
                     }
@@ -272,6 +324,9 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
           }
      }
    *no_rep = 0;
+#ifdef DDD_DO
+   spaces--;
+#endif
    return in;
 }
 
@@ -1012,9 +1067,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);
@@ -1035,6 +1092,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);
 }
 
index a971120..cabdaf2 100644 (file)
@@ -1398,6 +1398,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;
index 857a755..ff6a95d 100644 (file)
@@ -279,10 +279,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)