Can someone review and if, bug fix is ok commit the below patch please. Thanks Shilpa
------- Original Message ------- Sender : SHILPA ONKAR SINGH<shilpa.si...@samsung.com> Lead Engineer/SISO-BSG/Samsung Electronics Date : May 03, 2012 16:06 (GMT+09:00) Title : [E-devel] [Edje]: Bug Fix: Edje draggable jumps when external events is used. Hi All, 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. collections { group { name: "example/group"; min: 720 150; parts { part { name: "bg"; type: RECT; mouse_events: 0; description { state: "default" 0.0; } } // bg part { name: "title"; type: TEXT; mouse_events: 0; description { state: "default" 0.0; color: 0 0 0 255; rel1 { relative: 0.0 0.0; offset: 0 0; to: "bg"; } rel2 { relative: 1.0 0.2; offset: -1 -1; to: "bg"; } text { text: "Drag Example"; size: 16; font: "sans"; min: 1 1; } } } part { name: "drag_area"; type: RECT; mouse_events: 0; description { state: "default" 0.0; min: 0 80; max: 9999 80; color: 0 0 0 255; align: 0.5 0.5; rel1 { relative: 0.1 0.0; offset: -5 0; } rel2 { relative: 0.9 1.0; offset: 4 0; } color: 255 0 0 255; } } // drag_area part { name: "example/knob"; type: RECT; mouse_events: 0; dragable { confine: "drag_area"; x: 1 1 0; y: 0 0 0; } description { state: "default" 0.0; min: 16 80; max: 16 80; fixed: 1 1; align: 0 0; visible: 1; color: 255 0 255 255; rel1 {relative: 0.0 0.0; to_y: "drag_area";} rel2 {relative: 0.0 1.0; to_y: "drag_area";} } } // example/knob part{ name: "event"; type: RECT; mouse_events: 1; scale: 1; description{ state: "default" 0.0; min: 80 80; fixed: 1 1; rel1.to: "example/knob"; rel2.to: "example/knob"; color: 0 0 255 80; } dragable{ events: "example/knob"; } } } } } Thanks & Regards Shilpa Singh ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel