evas: Fix evas_objects_at_xy_get() for smart objects

Due to the way the clip geometry calculation changed
(see 25d77bc1d2) to be
based on the bounding box rather than the raw geometry
of smart objects, the internal function
evas_object_is_in_output_rect() now returns true if the
rectangle intersects with that bounding box, even if
it's outside the raw geometry.

This breaks the drop area in E's pager, as it relies on
evas_objects_at_xy_get() to find which objects are at
this point. What I saw on my desktop was that only the
lower 10 or 20 pixels were droppable in the pager,
as maximized windows would have shadows covering the
upper 20 pixels or so.

Arguably objects_at_xy_get could also return all objects
at (x,y) including smart objects that extend beyong their
geometry. This can be added as a flag in the EO API, but
not in the legacy API.
This commit is contained in:
Jean-Philippe Andre 2016-08-10 13:52:26 +09:00
parent 8d6d395358
commit 5130ce98db
1 changed files with 11 additions and 1 deletions

View File

@ -2035,7 +2035,17 @@ _evas_canvas_objects_at_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_C
evas_object_clip_recalc(obj);
if ((evas_object_is_in_output_rect(eo_obj, obj, xx, yy, 1, 1)) &&
(!obj->clip.clipees))
in = eina_list_prepend(in, eo_obj);
{
// evas_object_is_in_output_rect is based on the clip which
// may be larger than the geometry (bounding box)
if (!RECTS_INTERSECT(xx, yy, 1, 1,
obj->cur->geometry.x,
obj->cur->geometry.y,
obj->cur->geometry.w,
obj->cur->geometry.h))
continue;
in = eina_list_prepend(in, eo_obj);
}
}
}
return in;