summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorSHILPA ONKAR SINGH <shilpa.singh@samsung.com>2012-05-21 10:08:18 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-05-21 10:08:18 +0000
commit510cada94b9bd989f2baedb6cb33495d2d24f585 (patch)
treefdfd067af14ca546781743cb4f237bd9811d0fee /legacy
parenta028e6d56606ebc15200166478632876af1d0a0c (diff)
From: SHILPA ONKAR SINGH <shilpa.singh@samsung.com>
Subject: [E-devel] [Edje]: Bug Fix: Edje draggable jumps when external events is used. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. demo edc pasted below to reproduce the issue. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. demo edc pasted below to reproduce the issue. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. demo edc pasted below to reproduce the issue. Please find attached bug fix patch for edje draggable jump issue when external event area is used. Bug: When an external event area is used for edje draggable and when after mouse move if immediate mouse down is done then the draggable jumps back to its original position. Analysis: In _edje_mouse_down_signal_cb When an external event area is set i.e., when rp->events_to is set. tmp.x value is set to 0, need_reset is set to 1 and also _edje_recalc_do is called including emitting "drag" signal. this code is unnecessary/buggy and instead it causes the jump. 1. In mouse down only drag->down.x and drag->down.y needs to be set which is being set below and tmp value need not be reset to 0 as tmp value is calculated in mouse move based on drag->down.x and drag->down.y values. 2. need_reset is already set in mouse up hence need not be set in mouse down again. 3. edje_recalc_do is the function which actually causes the movement of draggable based on tmp value hence need not be called in mouse down. because of the above code race condition happens and as tmp value is being set to 0 and need reset is also enabled the draggable jumps back to where it started. 4. "drag": is sent even before "drag,start" [ should not /need not be sent in mouse down ] All the above code is added only when external event area is set and the above code is not even related to whether external event is set or not. Solution: When an external event area is set directly equating rp = rp->events_to and sending mouse,down would be enough, as down.x and down.y is set below including sending drag,start. Recalc_do should be called only in mouse move as its responsible for movement including setting tmp value. need_reset is already set in mouse up. drag should not be sent from mouse down. Change Description: Bug Fix: Edje Draggable jumps when mouse down is done immediately after mouse move when an external event area is used. SVN revision: 71277
Diffstat (limited to 'legacy')
-rw-r--r--legacy/edje/ChangeLog5
-rw-r--r--legacy/edje/src/lib/edje_callbacks.c64
2 files changed, 11 insertions, 58 deletions
diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog
index 3ff4a2bfdc..610e23d934 100644
--- a/legacy/edje/ChangeLog
+++ b/legacy/edje/ChangeLog
@@ -466,3 +466,8 @@
4662012-05-20 Cedric Bail 4662012-05-20 Cedric Bail
467 467
468 * Use Eina_File instead of fopen when possible in edje_cc. 468 * Use Eina_File instead of fopen when possible in edje_cc.
469
4702012-05-21 Shilpa Onkar Singh
471
472 * Fix patch for edje draggable jump issue when external event
473 area is used for the dragable.
diff --git a/legacy/edje/src/lib/edje_callbacks.c b/legacy/edje/src/lib/edje_callbacks.c
index 2b02891e12..a5acf7bf84 100644
--- a/legacy/edje/src/lib/edje_callbacks.c
+++ b/legacy/edje/src/lib/edje_callbacks.c
@@ -109,64 +109,12 @@ _edje_mouse_down_signal_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi
109 109
110 if (rp->events_to) 110 if (rp->events_to)
111 { 111 {
112 int x = 0, y = 0; 112 rp = rp->events_to;
113 Edje_Real_Part *events; 113 if (!ignored)
114 114 {
115 events = rp->events_to; 115 snprintf(buf, sizeof(buf), "mouse,down,%i", ev->button);
116 evas_object_geometry_get(rp->object, &x, &y, NULL, NULL); 116 _edje_emit(ed, buf, rp->part->name);
117 117 }
118 if ((events->part->dragable.x) || (events->part->dragable.y))
119 {
120 if (events->part->dragable.x)
121 {
122 events->drag->down.x = ev->canvas.x;
123 events->drag->tmp.x = 0;
124 }
125 if (events->part->dragable.y)
126 {
127 events->drag->down.y = ev->canvas.y;
128 events->drag->tmp.y = 0;
129 }
130
131 if (!ignored)
132 {
133 snprintf(buf, sizeof(buf), "mouse,down,%i", ev->button);
134 _edje_emit(ed, buf, events->part->name);
135 }
136 ed->dirty = 1;
137 ed->recalc_call = 1;
138#ifdef EDJE_CALC_CACHE
139 rp->invalidate = 1;
140#endif
141 }
142 _edje_recalc_do(ed);
143 /*
144 _edje_thaw(ed);
145 _edje_unref(ed);
146 _edje_ref(ed);
147 _edje_freeze(ed);
148 */
149 rp = events;
150 {
151 FLOAT_T dx = ZERO, dy = ZERO;
152
153 _edje_part_dragable_calc(ed, rp, &dx, &dy);
154
155 if ((dx != rp->drag->val.x) || (dy != rp->drag->val.y))
156 {
157 rp->drag->val.x = dx;
158 rp->drag->val.y = dy;
159 if (!ignored)
160 _edje_emit(ed, "drag", rp->part->name);
161 ed->recalc_call = 1;
162 ed->dirty = 1;
163#ifdef EDJE_CALC_CACHE
164 rp->invalidate = 1;
165#endif
166 rp->drag->need_reset = 1;
167 _edje_recalc_do(ed);
168 }
169 }
170 } 118 }
171 119
172 if (rp->drag) 120 if (rp->drag)