summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-08-08 11:31:28 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-08-08 11:31:28 -0400
commit2f7e22ccf4f525d9be65921bb584771c033a253a (patch)
tree4c8c78afc069d9201341704b999274c78ee157a9
parentb2d8803b95d138c6cde8c603eceaf1cbe90db2ff (diff)
move new version of e_comp_top_window_at_xy_get() to dnd, restore old version
this resolves pointer-based focus issues introduced while attempting to fix dnd-related bugs ref a4a2f6b09e88d555826a3f3b57bd8621c4b1752e ref 1a982fd72afc0aebaea5fd10f9acd08841291d60
-rw-r--r--src/bin/e_comp.c17
-rw-r--r--src/bin/e_dnd.c26
2 files changed, 28 insertions, 15 deletions
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index 82a2c2a75..7fc6a2b7d 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -1477,22 +1477,13 @@ E_API Ecore_Window
1477e_comp_top_window_at_xy_get(Evas_Coord x, Evas_Coord y) 1477e_comp_top_window_at_xy_get(Evas_Coord x, Evas_Coord y)
1478{ 1478{
1479 E_Client *ec; 1479 E_Client *ec;
1480 Eina_List *objs, *l;
1481 Evas_Object *o; 1480 Evas_Object *o;
1482 1481
1483 EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, 0); 1482 EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, 0);
1484 objs = evas_objects_at_xy_get(e_comp->evas, x, y, 0, 0); 1483 o = evas_object_top_at_xy_get(e_comp->evas, x, y, 0, 0);
1485 if (!objs) return e_comp->ee_win; 1484 if (!o) return e_comp->ee_win;
1486 EINA_LIST_FOREACH(objs, l, o) 1485 ec = evas_object_data_get(o, "E_Client");
1487 { 1486 if (ec) return e_client_util_pwin_get(ec);
1488 ec = evas_object_data_get(o, "E_Client");
1489 if (ec)
1490 {
1491 eina_list_free(objs);
1492 return e_client_util_pwin_get(ec);
1493 }
1494 }
1495 eina_list_free(objs);
1496 return e_comp->ee_win; 1487 return e_comp->ee_win;
1497} 1488}
1498 1489
diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c
index b6ad29dc0..91a97356c 100644
--- a/src/bin/e_dnd.c
+++ b/src/bin/e_dnd.c
@@ -829,6 +829,28 @@ _e_dnd_object_layer_get(E_Drop_Handler *h)
829 return adjust; 829 return adjust;
830} 830}
831 831
832static Ecore_Window
833_dnd_top_window_at_xy_get(Evas_Coord x, Evas_Coord y)
834{
835 E_Client *ec;
836 Eina_List *objs, *l;
837 Evas_Object *o;
838
839 objs = evas_objects_at_xy_get(e_comp->evas, x, y, 0, 0);
840 if (!objs) return e_comp->ee_win;
841 EINA_LIST_FOREACH(objs, l, o)
842 {
843 ec = evas_object_data_get(o, "E_Client");
844 if (ec)
845 {
846 eina_list_free(objs);
847 return e_client_util_pwin_get(ec);
848 }
849 }
850 eina_list_free(objs);
851 return e_comp->ee_win;
852}
853
832static int 854static int
833_e_drag_update(Ecore_Window root, int x, int y, unsigned int action) 855_e_drag_update(Ecore_Window root, int x, int y, unsigned int action)
834{ 856{
@@ -845,7 +867,7 @@ _e_drag_update(Ecore_Window root, int x, int y, unsigned int action)
845 867
846// double t1 = ecore_time_get(); //// 868// double t1 = ecore_time_get(); ////
847 if (_drag_current && !_xdnd) 869 if (_drag_current && !_xdnd)
848 win = e_comp_top_window_at_xy_get(x, y); 870 win = _dnd_top_window_at_xy_get(x, y);
849 else 871 else
850 win = root; 872 win = root;
851 873
@@ -969,7 +991,7 @@ _e_drag_end(int x, int y)
969 int dropped = 0; 991 int dropped = 0;
970 992
971 if (!_drag_current) return; 993 if (!_drag_current) return;
972 win = e_comp_top_window_at_xy_get(x, y); 994 win = _dnd_top_window_at_xy_get(x, y);
973 zone = e_comp_zone_xy_get(x, y); 995 zone = e_comp_zone_xy_get(x, y);
974 /* Pass -1, -1, so that it is possible to drop at the edge. */ 996 /* Pass -1, -1, so that it is possible to drop at the edge. */
975 if (zone) e_zone_flip_coords_handle(zone, -1, -1); 997 if (zone) e_zone_flip_coords_handle(zone, -1, -1);