[SVN merge] 53434
authorjh0506.yun <jh0506.yun@samsung.com>
Fri, 15 Oct 2010 07:45:10 +0000 (16:45 +0900)
committerjh0506.yun <jh0506.yun@samsung.com>
Fri, 15 Oct 2010 07:45:10 +0000 (16:45 +0900)
you wouldnt believe it if i told you.. but put in a block to disallow
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.

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

index 88cc0a2..9f084f8 100644 (file)
@@ -1,29 +1,7 @@
 #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
-
+// [SVN 53434 Merge] Please delete this comment when you merge 53434.
 
 static Eina_Inlist *
 get_layer_objects(Evas_Layer *l)
@@ -431,28 +409,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 +423,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 +492,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))
+   if (obj->doing.in_resize > 0)
      {
-#ifdef CALLBACK_NOOP
-       evas_object_inform_call_resize(obj);
-#endif
+        WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj);
        return;
      }
-#ifndef 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)) return;
    if (obj->layer->evas->events_frozen <= 0)
      {
        pass = evas_event_passes_through(obj);
@@ -553,12 +506,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 +1036,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 +1089,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 20743b7..0b77879 100644 (file)
@@ -446,6 +446,10 @@ struct _Evas_Object
 
    int                         last_event;
 
+   struct {  
+      int                      in_move, in_resize;  
+   } doing;           
+   
    unsigned char               delete_me;
    Evas_Object_Pointer_Mode    pointer_mode : 1;