Hello, This is Hermet. 

I have one problem because of the message event order.
Let me describe the situation. 

I added two clicked callback functions to one elm_button. 
Let's call the callback functions A and B 

It should be called sequentially definitely. 

I'm not sure why user should add separate callbacks but they may use this
case.
Because multiple callback functions for one widget are available. 

However, in some cases, the system is so much slow and user clicked the
button continually in a hurry.

So, the clicked message will be queued to the edje message queue (msgq) 

Now, it's time to process the signal callbacks. 

It will call  _edje_message_queue_process to process the queued message
events. 
Since user touched the buttons continually and the system could not process
the events yet, 
the clicked event messages will be queued in order. 

Let's suppose the count of clicked events as 4. 

Now It begins to process one. 

Because user added two callback functions, A will be called first. 
But in this A function, it creates an elementary widget which calls
"edje_object_message_signal_process" internally. 

It means, it will process the queued events(tmp_msgq) again plus additional
new queued events for its own widget. 

But next queued event is also button clicked event.
Thus, the A function will be called again even B function does not called
yet. 

Users might don't know about this but problem can be occurred. 

In this case, the callback function will be called like this order. A -> A
-> A -> A -> B -> B -> B -> B actually.  
However, it should be called like this A -> B -> A -> B -> A -> B -> A -> B.


The real scenario is like this. 
In a button callback A, user create a genlist then apply one style by using
elm_object_style_set. 



Could someone give me an advice?
Or Must be fixed the edje_message_queue?

Once, I attached the patch file for the edje_message_queue,
please consider and reply me. 

Thanks. 

Index: src/lib/edje_message_queue.c
===================================================================
--- src/lib/edje_message_queue.c        (revision 55738)
+++ src/lib/edje_message_queue.c        (working copy)
@@ -101,6 +101,17 @@
    ed = _edje_fetch(obj);
    if (!ed) return;
 
+   for (l = tmp_msgq; l; )
+     {
+        ln = l->next;
+        em = l->data;
+        if (em->edje == ed)
+          {
+             tmpq = eina_list_append(tmpq, em);
+             tmp_msgq = eina_list_remove_list(tmp_msgq, l);
+          }
+        l = ln;
+     }
    for (l = msgq; l; )
      {
         ln = l->next;
@@ -112,30 +123,16 @@
           }
         l = ln;
      }
-   /* a temporary message queue */
-   if (tmp_msgq)
-     {
-       while (tmpq)
-         {
-            tmp_msgq = eina_list_append(tmp_msgq, tmpq->data);
-            tmpq = eina_list_remove_list(tmpq, tmpq);
-         }
-     }
-   else
-     {
-       tmp_msgq = tmpq;
-       tmpq = NULL;
-     }
 
-   while (tmp_msgq)
+   while (tmpq)
      {
-       Edje_Message *em;
+        Edje_Message *em;
 
-       em = tmp_msgq->data;
-       tmp_msgq = eina_list_remove_list(tmp_msgq, tmp_msgq);
-       em->edje->message.num--;
-       _edje_message_process(em);
-       _edje_message_free(em);
+        em = tmpq->data;
+        tmpq = eina_list_remove_list(tmpq, tmpq);
+        em->edje->message.num--;
+        _edje_message_process(em);
+        _edje_message_free(em);
      }
 }
 
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to