No need to convert frame geometry to virtual...we can just compare

actual canvas geometry when doing collision detection.

Port the previous "JackDanielz" fix (using frame geometry vs using
object geometry) to the actual move function also.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 82868
This commit is contained in:
Christopher Michael 2013-01-16 09:01:30 +00:00 committed by Christopher Michael
parent 4a49bf8b05
commit 39e9f03048
1 changed files with 8 additions and 17 deletions

View File

@ -806,7 +806,6 @@ _e_smart_randr_monitor_cb_moving(void *data, Evas_Object *obj, void *event EINA_
Eina_List *l = NULL;
Evas_Object *mon;
Evas_Coord ox = 0, oy = 0;
Eina_Rectangle o;
/* data is the randr object */
if (!(o_randr = data)) return;
@ -817,13 +816,9 @@ _e_smart_randr_monitor_cb_moving(void *data, Evas_Object *obj, void *event EINA_
/* get the current frame geometry of the monitor we were passed in */
e_smart_monitor_frame_geometry_get(obj, &ox, &oy, NULL, NULL);
/* convert frame geometry into virtual space */
e_layout_coord_canvas_to_virtual(sd->o_layout, ox, oy, &o.x, &o.y);
/* loop the list of monitors */
EINA_LIST_FOREACH(sd->monitors, l, mon)
{
Eina_Rectangle m;
Evas_Coord fx = 0, fy = 0, fw = 0, fh = 0;
/* if this monitor is the one we want to skip, than skip it */
@ -832,12 +827,8 @@ _e_smart_randr_monitor_cb_moving(void *data, Evas_Object *obj, void *event EINA_
/* get the geometry of the monitor frame */
e_smart_monitor_frame_geometry_get(mon, &fx, &fy, &fw, &fh);
/* convert frame geometry into virtual space */
e_layout_coord_canvas_to_virtual(sd->o_layout, fx, fy, &m.x, &m.y);
e_layout_coord_canvas_to_virtual(sd->o_layout, fw, fh, &m.w, &m.h);
/* check if the moved monitor is inside an existing one */
if (E_INSIDE(o.x, o.y, m.x, m.y, m.w, m.h))
if (E_INSIDE(ox, oy, fx, fy, fw, fh))
{
/* turn on the drop zone so tell user they can drop here */
e_smart_monitor_drop_zone_set(mon, EINA_TRUE);
@ -861,7 +852,7 @@ _e_smart_randr_monitor_cb_moved(void *data, Evas_Object *obj, void *event EINA_U
E_Smart_Data *sd;
Eina_List *l = NULL;
Evas_Object *mon;
Eina_Rectangle o;
Evas_Coord ox = 0, oy = 0;
/* data is the randr object */
if (!(o_randr = data)) return;
@ -869,22 +860,22 @@ _e_smart_randr_monitor_cb_moved(void *data, Evas_Object *obj, void *event EINA_U
/* try to get the RandR objects smart data */
if (!(sd = evas_object_smart_data_get(o_randr))) return;
/* get the current geometry of the monitor we were passed in */
e_layout_child_geometry_get(obj, &o.x, &o.y, &o.w, &o.h);
/* get the current frame geometry of the monitor we were passed in */
e_smart_monitor_frame_geometry_get(obj, &ox, &oy, NULL, NULL);
/* loop the list of monitors */
EINA_LIST_FOREACH(sd->monitors, l, mon)
{
Eina_Rectangle m;
Evas_Coord fx = 0, fy = 0, fw = 0, fh = 0;
/* if this monitor is the one we want to skip, than skip it */
if (mon == obj) continue;
/* get the current geometry of this monitor */
e_layout_child_geometry_get(mon, &m.x, &m.y, &m.w, &m.h);
/* get the geometry of the monitor frame */
e_smart_monitor_frame_geometry_get(mon, &fx, &fy, &fw, &fh);
/* check if the moved monitor is inside an existing one */
if (E_INSIDE(o.x, o.y, m.x, m.y, m.w, m.h))
if (E_INSIDE(ox, oy, fx, fy, fw, fh))
{
/* clone this monitor into the obj monitor */
e_smart_monitor_clone_add(mon, obj);