Dear all.

I made a small patch to prevent retard mouse event process.
At certain circumstance (like as genlist select callback + naviframe item push),
some events are repeat processed.

If some evas_objects're iterating in evas_event_feed_mouse_up and
mouse_out event's emitted by other interrupt(such as naviframe item push),
then some evas_objects events are multiple processed by
evas_object_event_callback_call.

More elaborating it with a example.
There are a genlist and a multibuttonentry on genlist item.
When a user clicks multibuttonentry then evas will process mouse down and up.
in evas_event_feed_mouse_up, it gets evas object list to process mouse events.
Then in the evas object list, there are two evas objects - rect and textblock.
Two objects have its own parents.

the rect has below parents.
----------------------------------------
edje  - genlist item
elm_genlist_pan
edje
multibuttonentry
box
entry
els_scroller  (0x2a601788)
rect                                      <== the rect

the textblock has below parents.
----------------------------------------------
edje - genlist item
elm_genlist_pan
edje
multibuttonentry
box
entry
els_scroller(0x2a601788)
edje
elm_pan
edje
textblock                           <== the textblock

(note : two evas object have same parent (els_scroller))

So normally mouse up callbacks event propagates to its own parent.
the rect is processed to genlist item. and the textblock is processed
to genlist item.
but when els_scroller is processed, it's blocked by checking event
type and event id checking.

Mouse Up(rect) ->  Mouse Up(textblock)
event_id (3)      ->   event_id (3)

evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type
type, void *event_info, int event_id)
{
   ...
   if ((obj->delete_me) || (!obj->layer)) return;
   if ((obj->last_event == event_id) &&
       (obj->last_event_type == type)) return;
     <=== blocked

However if naviframe item is pushed in the middle of mouse up processing.
It can break into mouse up. So it's processed like below.

Mouse Up(rect) -> Mouse Out(rect) -> Mouse Out(textblock) -> Mouse Up(textblock)
event_id (3)      -> event_id(4)         -> event_id(4)
-> event_id(3)
(note Mouse_Out is made by naviframe item push for event freezing)

If that, there's no mechanism to block that repeat processing same event.
So I suggest this patch.
This patch blocks old events if there's no reason to process.
(It blocks old mouse_up event because mouse_out is processed.)

And I think it also clear the bug in
"[E-devel] event repetition with elm_naviframe/elm_genlist"

Thank you.
Index: evas/src/lib/canvas/evas_callbacks.c
===================================================================
--- evas/src/lib/canvas/evas_callbacks.c        (리비전 67750)
+++ evas/src/lib/canvas/evas_callbacks.c        (작업 사본)
@@ -172,6 +172,15 @@
    if ((obj->delete_me) || (!obj->layer)) return;
    if ((obj->last_event == event_id) &&
        (obj->last_event_type == type)) return;
+   if (obj->last_event > event_id)
+     {
+        if ((obj->last_event_type == EVAS_CALLBACK_MOUSE_OUT) &&
+            ((type >= EVAS_CALLBACK_MOUSE_DOWN) &&
+             (type <= EVAS_CALLBACK_MULTI_MOVE)))
+          {
+             return;
+          }
+     }
    obj->last_event = event_id;
    obj->last_event_type = type;
    if (!(e = obj->layer->evas)) return;
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to