forked from enlightenment/efl
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. SVN revision: 53434
This commit is contained in:
parent
1df6a75020
commit
be7683efbd
|
@ -1,30 +1,6 @@
|
||||||
#include "evas_common.h"
|
#include "evas_common.h"
|
||||||
#include "evas_private.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 *
|
static Eina_Inlist *
|
||||||
get_layer_objects(Evas_Layer *l)
|
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();
|
MAGIC_CHECK_END();
|
||||||
if (obj->delete_me) return;
|
if (obj->delete_me) return;
|
||||||
if (evas_object_intercept_call_move(obj, x, y)) return;
|
if (evas_object_intercept_call_move(obj, x, y)) return;
|
||||||
#ifdef FORWARD_NOOP_MOVES_TO_SMART_OBJS
|
if (obj->doing.in_move > 0)
|
||||||
if (obj->smart.smart)
|
|
||||||
{
|
{
|
||||||
if (obj->smart.smart->smart_class->move)
|
WRN("evas_object_move() called on object %p when in the middle of moving the same object", obj);
|
||||||
obj->smart.smart->smart_class->move(obj, x, y);
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
if ((obj->cur.geometry.x == x) && (obj->cur.geometry.y == y)) return;
|
||||||
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->smart.smart->smart_class->move)
|
|
||||||
obj->smart.smart->smart_class->move(obj, x, y);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (obj->layer->evas->events_frozen <= 0)
|
if (obj->layer->evas->events_frozen <= 0)
|
||||||
{
|
{
|
||||||
pass = evas_event_passes_through(obj);
|
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.x,
|
||||||
obj->layer->evas->pointer.y, 1, 1);
|
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.x = x;
|
||||||
obj->cur.geometry.y = y;
|
obj->cur.geometry.y = y;
|
||||||
//// obj->cur.cache.geometry.validity = 0;
|
//// obj->cur.cache.geometry.validity = 0;
|
||||||
evas_object_change(obj);
|
evas_object_change(obj);
|
||||||
evas_object_clip_dirty(obj);
|
evas_object_clip_dirty(obj);
|
||||||
|
obj->doing.in_move--;
|
||||||
if (obj->layer->evas->events_frozen <= 0)
|
if (obj->layer->evas->events_frozen <= 0)
|
||||||
{
|
{
|
||||||
evas_object_recalc_clippees(obj);
|
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 (obj->delete_me) return;
|
||||||
if (w < 0) w = 0; if (h < 0) h = 0;
|
if (w < 0) w = 0; if (h < 0) h = 0;
|
||||||
if (evas_object_intercept_call_resize(obj, w, h)) return;
|
if (evas_object_intercept_call_resize(obj, w, h)) return;
|
||||||
#ifdef FORWARD_NOOP_RESIZES_TO_SMART_OBJS
|
if (obj->doing.in_resize > 0)
|
||||||
if (obj->smart.smart)
|
|
||||||
{
|
{
|
||||||
if (obj->smart.smart->smart_class->resize)
|
WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj);
|
||||||
obj->smart.smart->smart_class->resize(obj, w, h);
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
if ((obj->cur.geometry.w == w) && (obj->cur.geometry.h == h)) return;
|
||||||
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->smart.smart->smart_class->resize)
|
|
||||||
obj->smart.smart->smart_class->resize(obj, w, h);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (obj->layer->evas->events_frozen <= 0)
|
if (obj->layer->evas->events_frozen <= 0)
|
||||||
{
|
{
|
||||||
pass = evas_event_passes_through(obj);
|
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.x,
|
||||||
obj->layer->evas->pointer.y, 1, 1);
|
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.w = w;
|
||||||
obj->cur.geometry.h = h;
|
obj->cur.geometry.h = h;
|
||||||
//// obj->cur.cache.geometry.validity = 0;
|
//// obj->cur.cache.geometry.validity = 0;
|
||||||
evas_object_change(obj);
|
evas_object_change(obj);
|
||||||
evas_object_clip_dirty(obj);
|
evas_object_clip_dirty(obj);
|
||||||
|
obj->doing.in_resize--;
|
||||||
/* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) */
|
/* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) */
|
||||||
if (obj->layer->evas->events_frozen <= 0)
|
if (obj->layer->evas->events_frozen <= 0)
|
||||||
{
|
{
|
||||||
|
@ -1077,9 +1034,6 @@ evas_object_show(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
if (obj->cur.visible)
|
if (obj->cur.visible)
|
||||||
{
|
{
|
||||||
#ifdef CALLBACK_NOOP
|
|
||||||
evas_object_inform_call_show(obj);
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
obj->cur.visible = 1;
|
obj->cur.visible = 1;
|
||||||
|
@ -1133,9 +1087,6 @@ evas_object_hide(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
if (!obj->cur.visible)
|
if (!obj->cur.visible)
|
||||||
{
|
{
|
||||||
#ifdef CALLBACK_NOOP
|
|
||||||
evas_object_inform_call_hide(obj);
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
obj->cur.visible = 0;
|
obj->cur.visible = 0;
|
||||||
|
|
|
@ -445,6 +445,10 @@ struct _Evas_Object
|
||||||
int mouse_grabbed;
|
int mouse_grabbed;
|
||||||
|
|
||||||
int last_event;
|
int last_event;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int in_move, in_resize;
|
||||||
|
} doing;
|
||||||
|
|
||||||
unsigned char delete_me;
|
unsigned char delete_me;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue