From 89664c894e3c49c0204cb6f485406f0dec26a627 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 21 May 2013 13:52:11 +0100 Subject: [PATCH] layout/comp "top at xy" functions now allow restricting based on visibility fixes desktop gadget dnd --- src/bin/e_comp.c | 4 ++-- src/bin/e_comp.h | 2 +- src/bin/e_dnd.c | 4 ++-- src/bin/e_layout.c | 5 +++-- src/bin/e_layout.h | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index df7461c75..007032eca 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -5255,7 +5255,7 @@ e_comp_zone_update(E_Comp_Zone *cz) } EAPI Ecore_X_Window -e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y, Ecore_X_Window *ignore, unsigned int ignore_num) +e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y, Eina_Bool vis, Ecore_X_Window *ignore, unsigned int ignore_num) { E_Comp_Win *cw; Evas_Object *o; @@ -5276,7 +5276,7 @@ e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y, Ecore_X_Windo ignore_list = eina_list_append(ignore_list, cw->effect_obj); } } - o = e_layout_top_child_at_xy_get(c->layout, x, y, ignore_list); + o = e_layout_top_child_at_xy_get(c->layout, x, y, vis, ignore_list); eina_list_free(ignore_list); cw = evas_object_data_get(o, "comp_win"); if (!cw) return c->ee_win; diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h index 98a806896..c63513aaa 100644 --- a/src/bin/e_comp.h +++ b/src/bin/e_comp.h @@ -248,7 +248,7 @@ EAPI void e_comp_win_opacity_set(E_Comp_Win *cw, unsigned int opacity); EAPI E_Comp *e_comp_get(void *o); EAPI void e_comp_populate(E_Comp *c); -EAPI Ecore_X_Window e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y, Ecore_X_Window *ignore, unsigned int ignore_num); +EAPI Ecore_X_Window e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y, Eina_Bool vis, Ecore_X_Window *ignore, unsigned int ignore_num); /* for injecting objects into the comp layout */ EAPI E_Comp_Win *e_comp_object_inject(E_Comp *c, Evas_Object *obj, E_Object *eobj, E_Layer layer); diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index c7b45a596..18c591f1c 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -766,7 +766,7 @@ _e_drag_update(Ecore_X_Window root, int x, int y, Ecore_X_Atom action) { Ecore_X_Window ignore[1]; ignore[0] = _drag_win; - win = e_comp_top_window_at_xy_get(e_comp_get(_drag_current), x, y, ignore, 1); + win = e_comp_top_window_at_xy_get(e_comp_get(_drag_current), x, y, 1, ignore, 1); } else win = root; @@ -894,7 +894,7 @@ _e_drag_end(int x, int y) if (!_drag_current) return; ignore[0] = _drag_win; - win = e_comp_top_window_at_xy_get(e_comp_get(_drag_current), x, y, ignore, 1); + win = e_comp_top_window_at_xy_get(e_comp_get(_drag_current), x, y, 1, ignore, 1); zone = e_container_zone_at_point_get(_drag_current->container, x, y); /* Pass -1, -1, so that it is possible to drop at the edge. */ if (zone) e_zone_flip_coords_handle(zone, -1, -1); diff --git a/src/bin/e_layout.c b/src/bin/e_layout.c index c075184cd..60414148e 100644 --- a/src/bin/e_layout.c +++ b/src/bin/e_layout.c @@ -302,7 +302,7 @@ e_layout_children_get(Evas_Object *obj) } EAPI Evas_Object * -e_layout_top_child_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y, const Eina_List *ignore) +e_layout_top_child_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Eina_Bool vis, const Eina_List *ignore) { E_Smart_Data *sd; E_Layout_Item *li; @@ -314,7 +314,8 @@ e_layout_top_child_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y, const if (E_INSIDE(x, y, li->x, li->y, li->w, li->h)) { if (eina_list_data_find(ignore, li->obj)) continue; - return li->obj; + if ((!vis) || evas_object_visible_get(li->obj)) + return li->obj; } return NULL; } diff --git a/src/bin/e_layout.h b/src/bin/e_layout.h index 43a6fdfd5..730149aa3 100644 --- a/src/bin/e_layout.h +++ b/src/bin/e_layout.h @@ -23,7 +23,7 @@ EAPI void e_layout_child_geometry_get(Evas_Object *obj, Evas_Coord *x, E EAPI void e_layout_unpack (Evas_Object *obj); EAPI Eina_List *e_layout_children_get(Evas_Object *obj); -EAPI Evas_Object *e_layout_top_child_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y, const Eina_List *ignore); +EAPI Evas_Object *e_layout_top_child_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Eina_Bool vis, const Eina_List *ignore); EAPI Evas_Object *e_layout_child_below_get(Evas_Object *obj); EAPI Evas_Object *e_layout_child_above_get(Evas_Object *obj);