forked from enlightenment/efl
evas/events - removed events_frozen check in evas_event_passes_through()
in most cases, it is performed twice inside and outside of the function in inefficient way. and calling of events_frozen in the passes_through() is not understable in the view of functional consistency. Check is separately would be better. SVN revision: 65269
This commit is contained in:
parent
15f0f3e044
commit
61655ba055
|
@ -111,7 +111,7 @@ evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y)
|
|||
Evas_Layer *lay;
|
||||
Eina_List *in = NULL;
|
||||
|
||||
if (!e->layers) return NULL;
|
||||
if ((!e->layers) || (e->events_frozen > 0)) return NULL;
|
||||
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
|
||||
{
|
||||
int norep = 0;
|
||||
|
@ -575,19 +575,19 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
|
|||
{
|
||||
ev.cur.canvas.x = e->pointer.x;
|
||||
ev.cur.canvas.y = e->pointer.y;
|
||||
_evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
|
||||
if (((evas_object_clippers_is_visible(obj)) ||
|
||||
(obj->mouse_grabbed)) &&
|
||||
_evas_event_havemap_adjust(obj, &ev.cur.canvas.x,
|
||||
&ev.cur.canvas.y,
|
||||
obj->mouse_grabbed);
|
||||
if ((e->events_frozen <= 0) &&
|
||||
(evas_object_clippers_is_visible(obj) ||
|
||||
obj->mouse_grabbed) &&
|
||||
(!evas_event_passes_through(obj)) &&
|
||||
(!evas_event_freezes_through(obj)) &&
|
||||
(!obj->clip.clipees))
|
||||
{
|
||||
if ((px != x) || (py != y))
|
||||
{
|
||||
if (e->events_frozen <= 0)
|
||||
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
|
||||
}
|
||||
}
|
||||
else
|
||||
outs = eina_list_append(outs, obj);
|
||||
if (e->delete_me) break;
|
||||
|
@ -695,22 +695,22 @@ evas_event_feed_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const
|
|||
/* in list */
|
||||
// FIXME: i don't think we need this
|
||||
// evas_object_clip_recalc(obj);
|
||||
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
|
||||
((evas_object_clippers_is_visible(obj)) ||
|
||||
(obj->mouse_grabbed)) &&
|
||||
(eina_list_data_find(ins, obj)) &&
|
||||
if ((e->events_frozen <= 0) &&
|
||||
evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
|
||||
(evas_object_clippers_is_visible(obj) ||
|
||||
obj->mouse_grabbed) &&
|
||||
eina_list_data_find(ins, obj) &&
|
||||
(!evas_event_passes_through(obj)) &&
|
||||
(!evas_event_freezes_through(obj)) &&
|
||||
(!obj->clip.clipees) &&
|
||||
((!obj->precise_is_inside) ||
|
||||
(evas_object_is_inside(obj, x, y))))
|
||||
((!obj->precise_is_inside) || evas_object_is_inside(obj, x, y))
|
||||
)
|
||||
{
|
||||
if ((px != x) || (py != y))
|
||||
{
|
||||
ev.cur.canvas.x = e->pointer.x;
|
||||
ev.cur.canvas.y = e->pointer.y;
|
||||
_evas_event_havemap_adjust(obj, &ev.cur.canvas.x, &ev.cur.canvas.y, obj->mouse_grabbed);
|
||||
if (e->events_frozen <= 0)
|
||||
evas_object_event_callback_call(obj, EVAS_CALLBACK_MOUSE_MOVE, &ev);
|
||||
}
|
||||
}
|
||||
|
@ -1087,8 +1087,8 @@ evas_event_feed_multi_move(Evas *e,
|
|||
copy = evas_event_list_copy(e->pointer.object.in);
|
||||
EINA_LIST_FOREACH(copy, l, obj)
|
||||
{
|
||||
if (((evas_object_clippers_is_visible(obj)) ||
|
||||
(obj->mouse_grabbed)) &&
|
||||
if ((e->events_frozen <= 0) &&
|
||||
(evas_object_clippers_is_visible(obj) || obj->mouse_grabbed) &&
|
||||
(!evas_event_passes_through(obj)) &&
|
||||
(!evas_event_freezes_through(obj)) &&
|
||||
(!obj->clip.clipees))
|
||||
|
@ -1102,7 +1102,6 @@ evas_event_feed_multi_move(Evas *e,
|
|||
ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
|
||||
if (y != ev.cur.canvas.y)
|
||||
ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
|
||||
if (e->events_frozen <= 0)
|
||||
evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev);
|
||||
}
|
||||
if (e->delete_me) break;
|
||||
|
@ -1146,15 +1145,16 @@ evas_event_feed_multi_move(Evas *e,
|
|||
/* in list */
|
||||
// FIXME: i don't think we need this
|
||||
// evas_object_clip_recalc(obj);
|
||||
if (evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
|
||||
((evas_object_clippers_is_visible(obj)) ||
|
||||
(obj->mouse_grabbed)) &&
|
||||
(eina_list_data_find(ins, obj)) &&
|
||||
if ((e->events_frozen <= 0) &&
|
||||
evas_object_is_in_output_rect(obj, x, y, 1, 1) &&
|
||||
(evas_object_clippers_is_visible(obj) ||
|
||||
obj->mouse_grabbed) &&
|
||||
eina_list_data_find(ins, obj) &&
|
||||
(!evas_event_passes_through(obj)) &&
|
||||
(!evas_event_freezes_through(obj)) &&
|
||||
(!obj->clip.clipees) &&
|
||||
((!obj->precise_is_inside) ||
|
||||
(evas_object_is_inside(obj, x, y))))
|
||||
((!obj->precise_is_inside) || evas_object_is_inside(obj, x, y))
|
||||
)
|
||||
{
|
||||
ev.cur.canvas.x = x;
|
||||
ev.cur.canvas.y = y;
|
||||
|
@ -1165,7 +1165,6 @@ evas_event_feed_multi_move(Evas *e,
|
|||
ev.cur.canvas.xsub = ev.cur.canvas.x; // fixme - lost precision
|
||||
if (y != ev.cur.canvas.y)
|
||||
ev.cur.canvas.ysub = ev.cur.canvas.y; // fixme - lost precision
|
||||
if (e->events_frozen <= 0)
|
||||
evas_object_event_callback_call(obj, EVAS_CALLBACK_MULTI_MOVE, &ev);
|
||||
}
|
||||
if (e->delete_me) break;
|
||||
|
|
|
@ -1130,7 +1130,8 @@ evas_object_top_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool i
|
|||
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
||||
{
|
||||
if (obj->delete_me) continue;
|
||||
if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue;
|
||||
if ((!include_pass_events_objects) &&
|
||||
(evas_event_passes_through(obj))) continue;
|
||||
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
||||
evas_object_clip_recalc(obj);
|
||||
if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
|
||||
|
@ -1144,8 +1145,8 @@ evas_object_top_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool i
|
|||
EAPI Evas_Object *
|
||||
evas_object_top_at_pointer_get(const Evas *e)
|
||||
{
|
||||
//// return evas_object_top_at_xy_get(e, e->pointer.canvas_x, e->pointer.canvas_y, 0, 0);
|
||||
return evas_object_top_at_xy_get(e, e->pointer.x, e->pointer.y, 1, 1);
|
||||
return evas_object_top_at_xy_get(e, e->pointer.x, e->pointer.y, EINA_TRUE,
|
||||
EINA_TRUE);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
|
@ -1174,7 +1175,8 @@ evas_object_top_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas
|
|||
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
||||
{
|
||||
if (obj->delete_me) continue;
|
||||
if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue;
|
||||
if ((!include_pass_events_objects) &&
|
||||
(evas_event_passes_through(obj))) continue;
|
||||
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
||||
evas_object_clip_recalc(obj);
|
||||
if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
|
||||
|
@ -1206,7 +1208,8 @@ evas_objects_at_xy_get(const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool incl
|
|||
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
||||
{
|
||||
if (obj->delete_me) continue;
|
||||
if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue;
|
||||
if ((!include_pass_events_objects) &&
|
||||
(evas_event_passes_through(obj))) continue;
|
||||
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
||||
evas_object_clip_recalc(obj);
|
||||
if ((evas_object_is_in_output_rect(obj, xx, yy, 1, 1)) &&
|
||||
|
@ -1256,7 +1259,8 @@ evas_objects_in_rectangle_get(const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Co
|
|||
EINA_INLIST_REVERSE_FOREACH(get_layer_objects(lay), obj)
|
||||
{
|
||||
if (obj->delete_me) continue;
|
||||
if ((!include_pass_events_objects) && (evas_event_passes_through(obj))) continue;
|
||||
if ((!include_pass_events_objects) &&
|
||||
(evas_event_passes_through(obj))) continue;
|
||||
if ((!include_hidden_objects) && (!obj->cur.visible)) continue;
|
||||
evas_object_clip_recalc(obj);
|
||||
if ((evas_object_is_in_output_rect(obj, xx, yy, ww, hh)) &&
|
||||
|
|
|
@ -54,8 +54,7 @@ evas_object_raise(Evas_Object *obj)
|
|||
else
|
||||
{
|
||||
if (obj->in_layer)
|
||||
obj->layer->objects = (Evas_Object *)eina_inlist_demote(EINA_INLIST_GET(obj->layer->objects),
|
||||
EINA_INLIST_GET(obj));
|
||||
obj->layer->objects = (Evas_Object *)eina_inlist_demote(EINA_INLIST_GET(obj->layer->objects), EINA_INLIST_GET(obj));
|
||||
}
|
||||
if (obj->clip.clipees)
|
||||
{
|
||||
|
@ -66,17 +65,15 @@ evas_object_raise(Evas_Object *obj)
|
|||
obj->restack = EINA_TRUE;
|
||||
evas_object_change(obj);
|
||||
evas_object_inform_call_restack(obj);
|
||||
if (obj->layer->evas->events_frozen <= 0)
|
||||
{
|
||||
if ((!evas_event_passes_through(obj)) &&
|
||||
(!evas_event_freezes_through(obj)))
|
||||
if (obj->layer->evas->events_frozen > 0) return;
|
||||
if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
|
||||
{
|
||||
if (!obj->smart.smart)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1) &&
|
||||
obj->cur.visible)
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1) && obj->cur.visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
|
@ -84,7 +81,6 @@ evas_object_raise(Evas_Object *obj)
|
|||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -116,17 +112,15 @@ evas_object_lower(Evas_Object *obj)
|
|||
obj->restack = EINA_TRUE;
|
||||
evas_object_change(obj);
|
||||
evas_object_inform_call_restack(obj);
|
||||
if (obj->layer->evas->events_frozen <= 0)
|
||||
{
|
||||
if ((!evas_event_passes_through(obj)) &&
|
||||
(!evas_event_freezes_through(obj)))
|
||||
if (obj->layer->evas->events_frozen > 0) return;
|
||||
if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
|
||||
{
|
||||
if (!obj->smart.smart)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1) &&
|
||||
obj->cur.visible)
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1) && obj->cur.visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
|
@ -134,7 +128,6 @@ evas_object_lower(Evas_Object *obj)
|
|||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -197,17 +190,15 @@ evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
|
|||
obj->restack = EINA_TRUE;
|
||||
evas_object_change(obj);
|
||||
evas_object_inform_call_restack(obj);
|
||||
if (obj->layer->evas->events_frozen <= 0)
|
||||
{
|
||||
if ((!evas_event_passes_through(obj)) &&
|
||||
(!evas_event_freezes_through(obj)))
|
||||
if (obj->layer->evas->events_frozen > 0) return;
|
||||
if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
|
||||
{
|
||||
if (!obj->smart.smart)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1) &&
|
||||
obj->cur.visible)
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1) && obj->cur.visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
|
@ -215,7 +206,6 @@ evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
|
|||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -278,17 +268,15 @@ evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
|
|||
obj->restack = EINA_TRUE;
|
||||
evas_object_change(obj);
|
||||
evas_object_inform_call_restack(obj);
|
||||
if (obj->layer->evas->events_frozen <= 0)
|
||||
{
|
||||
if ((!evas_event_passes_through(obj)) &&
|
||||
(!evas_event_freezes_through(obj)))
|
||||
if (obj->layer->evas->events_frozen > 0) return;
|
||||
if ((!evas_event_passes_through(obj)) && (!evas_event_freezes_through(obj)))
|
||||
{
|
||||
if (!obj->smart.smart)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1) &&
|
||||
obj->cur.visible)
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1) && obj->cur.visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
|
@ -296,7 +284,6 @@ evas_object_stack_below(Evas_Object *obj, Evas_Object *below)
|
|||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
|
|
|
@ -86,7 +86,6 @@ evas_event_freezes_through(Evas_Object *obj)
|
|||
static inline int
|
||||
evas_event_passes_through(Evas_Object *obj)
|
||||
{
|
||||
if (obj->layer->evas->events_frozen > 0) return 1;
|
||||
if (obj->pass_events) return 1;
|
||||
if (obj->parent_cache.pass_events_valid)
|
||||
return obj->parent_cache.pass_events;
|
||||
|
|
Loading…
Reference in New Issue