you wouldnt believe it if i told you.. but put in a block to disallow
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 15 Oct 2010 05:39:53 +0000 (05:39 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 15 Oct 2010 05:39:53 +0000 (05:39 +0000)
move or resize of an obj WHILE in the middle of a move or resize
already - some weird case someone has come up with where this happens
and things like smart clipped's "move relatvie by dx, dy" totally
screw up then. it's a totally unexpected case though. some circular
action has been created that logically shouldn't have existed.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@53434 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_main.c
src/lib/include/evas_private.h

index 4213dae..bac1a5a 100644 (file)
@@ -1,30 +1,6 @@
 #include "evas_common.h"
 #include "evas_private.h"
 
-/* FIXME: this broken e17's mouse cursor - need to figure out why */
-
-/* uncomment the next line if smart objects should be informed
- * if they are moved to the position they are already in
- * (e.g. if they are in 0,0 and you call evas_object_move(o, 0, 0)
- */
-//#define FORWARD_NOOP_MOVES_TO_SMART_OBJS
-
-/* likewise, for resizes
- */
-//#define FORWARD_NOOP_RESIZES_TO_SMART_OBJS
-
-/* Similar to FORWARD_NOOP_*, this will allow no-operations (those calls that
- * have values exactly like current state) to call EVAS_CALLBACK_*.
- *
- * For some unknown reason this was the default behavior so it is left as
- * a compile-time option, but will be deprecated and removed soon as it can
- * potentially lead to execution of unnecessary code.
- * by Gustavo, February 5th, 2009.
- * XXX: remove-me before e17 release!
- */
-//#define CALLBACK_NOOP
-
-
 static Eina_Inlist *
 get_layer_objects(Evas_Layer *l)
 {
@@ -431,28 +407,12 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
    MAGIC_CHECK_END();
    if (obj->delete_me) return;
    if (evas_object_intercept_call_move(obj, x, y)) return;
-#ifdef FORWARD_NOOP_MOVES_TO_SMART_OBJS
-   if (obj->smart.smart)
-     {
-       if (obj->smart.smart->smart_class->move)
-         obj->smart.smart->smart_class->move(obj, x, y);
-     }
-#endif
-   if ((obj->cur.geometry.x == x) &&
-       (obj->cur.geometry.y == y))
-     {
-#ifdef CALLBACK_NOOP
-       evas_object_inform_call_move(obj);
-#endif
-       return;
-     }
-#ifndef FORWARD_NOOP_MOVES_TO_SMART_OBJS
-   if (obj->smart.smart)
+   if (obj->doing.in_move > 0)
      {
-       if (obj->smart.smart->smart_class->move)
-         obj->smart.smart->smart_class->move(obj, x, y);
+        WRN("evas_object_move() called on object %p when in the middle of moving the same object", obj);
+        return;
      }
-#endif
+   if ((obj->cur.geometry.x == x) && (obj->cur.geometry.y == y)) return;
    if (obj->layer->evas->events_frozen <= 0)
      {
        pass = evas_event_passes_through(obj);
@@ -461,11 +421,18 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
                                              obj->layer->evas->pointer.x,
                                              obj->layer->evas->pointer.y, 1, 1);
      }
+   obj->doing.in_move++;
+   if (obj->smart.smart)
+     {
+       if (obj->smart.smart->smart_class->move)
+         obj->smart.smart->smart_class->move(obj, x, y);
+     }
    obj->cur.geometry.x = x;
    obj->cur.geometry.y = y;
 ////   obj->cur.cache.geometry.validity = 0;
    evas_object_change(obj);
    evas_object_clip_dirty(obj);
+   obj->doing.in_move--;
    if (obj->layer->evas->events_frozen <= 0)
      {
        evas_object_recalc_clippees(obj);
@@ -523,28 +490,12 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
    if (obj->delete_me) return;
    if (w < 0) w = 0; if (h < 0) h = 0;
    if (evas_object_intercept_call_resize(obj, w, h)) return;
-#ifdef FORWARD_NOOP_RESIZES_TO_SMART_OBJS
-   if (obj->smart.smart)
-     {
-       if (obj->smart.smart->smart_class->resize)
-         obj->smart.smart->smart_class->resize(obj, w, h);
-     }
-#endif
-   if ((obj->cur.geometry.w == w) &&
-       (obj->cur.geometry.h == h))
-     {
-#ifdef CALLBACK_NOOP
-       evas_object_inform_call_resize(obj);
-#endif
-       return;
-     }
-#ifndef FORWARD_NOOP_RESIZES_TO_SMART_OBJS
-   if (obj->smart.smart)
+   if (obj->doing.in_resize > 0)
      {
-       if (obj->smart.smart->smart_class->resize)
-         obj->smart.smart->smart_class->resize(obj, w, h);
+        WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj);
+        return;
      }
-#endif
+   if ((obj->cur.geometry.w == w) && (obj->cur.geometry.h == h)) return;
    if (obj->layer->evas->events_frozen <= 0)
      {
        pass = evas_event_passes_through(obj);
@@ -553,12 +504,18 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
                                              obj->layer->evas->pointer.x,
                                              obj->layer->evas->pointer.y, 1, 1);
      }
-
+   obj->doing.in_resize++;
+   if (obj->smart.smart)
+     {
+       if (obj->smart.smart->smart_class->resize)
+         obj->smart.smart->smart_class->resize(obj, w, h);
+     }
    obj->cur.geometry.w = w;
    obj->cur.geometry.h = h;
 ////   obj->cur.cache.geometry.validity = 0;
    evas_object_change(obj);
    evas_object_clip_dirty(obj);
+   obj->doing.in_resize--;
    /* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) */
    if (obj->layer->evas->events_frozen <= 0)
      {
@@ -1077,9 +1034,6 @@ evas_object_show(Evas_Object *obj)
      }
    if (obj->cur.visible)
      {
-#ifdef CALLBACK_NOOP
-       evas_object_inform_call_show(obj);
-#endif
        return;
      }
    obj->cur.visible = 1;
@@ -1133,9 +1087,6 @@ evas_object_hide(Evas_Object *obj)
      }
    if (!obj->cur.visible)
      {
-#ifdef CALLBACK_NOOP
-       evas_object_inform_call_hide(obj);
-#endif
        return;
      }
    obj->cur.visible = 0;
index 0dc746c..96707fa 100644 (file)
@@ -445,6 +445,10 @@ struct _Evas_Object
    int                         mouse_grabbed;
 
    int                         last_event;
+   
+   struct {
+      int                      in_move, in_resize;
+   } doing;
 
    unsigned char               delete_me;