From: Shilpa Singh Date: Wed, 21 Oct 2015 21:39:05 +0000 (-0700) Subject: elm_cnp: DnD/X11: correct drag window position in rotation X-Git-Tag: v1.16.0-beta3~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3cc2d73951831bfec3f5f7d30640db18ee70e66;p=platform%2Fupstream%2Felementary.git elm_cnp: DnD/X11: correct drag window position in rotation Summary: For various angles 90, 180, 270, the calculation of dnd window position is not proper causing window to be placed wrongly while dragging. Signed-Off By: Kumar Navneet @fix Test Plan: Longpress and drag and drop in entry by placing device at various angles 90, 180 and 270. Reviewers: woohyun, cedric, thiepha Reviewed By: thiepha Subscribers: navnbeet Differential Revision: https://phab.enlightenment.org/D3188 Signed-off-by: Cedric BAIL --- diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c index 00d5aa5..2f7ab7d 100644 --- a/src/lib/elm_cnp.c +++ b/src/lib/elm_cnp.c @@ -2233,8 +2233,6 @@ _x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, evas_object_show(icon); evas_object_show(dragwin); evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x3, &y3); - _dragx = x3 - x2; - _dragy = y3 - y2; rot = ecore_evas_rotation_get(ee); switch (rot) @@ -2242,18 +2240,26 @@ _x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, case 90: xr = y3; yr = ew - x3; + _dragx = y3 - y2; + _dragy = x3 - x2; break; case 180: xr = ew - x3; yr = eh - y3; + _dragx = x3 - x2; + _dragy = y3 - y2; break; case 270: xr = eh - y3; yr = x3; + _dragx = y3 - y2; + _dragy = x3 - x2; break; default: xr = x3; yr = y3; + _dragx = x3 - x2; + _dragy = y3 - y2; break; } x = ex + xr - _dragx;