edje: told you old man ! broadcasting message to all groups was a bad idea.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 10 Feb 2012 16:49:58 +0000 (16:49 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 10 Feb 2012 16:49:58 +0000 (16:49 +0000)
This patch try to prevent the broadcasting of targeted message. This should minimize
the problem generated on edje sub GROUP that didn't expect to see that much message
coming to them. It just a minimization of the problem, as message that don't target
explicitly a part are still propagated and can still break your edje usage from 1.0
to 1.1 version.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@67830 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/lib/edje_program.c

index f391098..bcc5547 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        on separate part.
        * Fix bug with filter preventing any action to be triggered.
 
+2012-02-10  Cedric Bail
+
+       * Prevent propagation of signal, when there is a matching target with edje GROUP.
+
index a96d411..2c9010e 100644 (file)
@@ -873,6 +873,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
 {
    Edje_Message_Signal emsg;
    const char *sep;
+   Eina_Bool broadcast = EINA_TRUE;
 
    if (ed->delete_me) return;
 
@@ -958,6 +959,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
               if (!ed2) goto end;
 
               _edje_emit(ed2, newsig, src);
+             broadcast = EINA_FALSE;
               break;
 
            case EDJE_PART_TYPE_EXTERNAL:
@@ -976,6 +978,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
                    if (!ed2) goto end;
                    _edje_emit(ed2, newsig, src);
                 }
+             broadcast = EINA_FALSE;
               break ;
 
            case EDJE_PART_TYPE_BOX:
@@ -988,6 +991,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
                    ed2 = _edje_fetch(child);
                    if (!ed2) goto end;
                    _edje_emit(ed2, newsig, src);
+                  broadcast = EINA_FALSE;
                 }
               break ;
 
@@ -1012,7 +1016,10 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
         emsg.data = NULL;
      }
 /* new sends code */
-   edje_object_message_send(ed->obj, EDJE_MESSAGE_SIGNAL, 0, &emsg);
+   if (broadcast)
+     edje_object_message_send(ed->obj, EDJE_MESSAGE_SIGNAL, 0, &emsg);
+   else
+     _edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg);
 /* old send code - use api now
    _edje_message_send(ed, EDJE_QUEUE_SCRIPT, EDJE_MESSAGE_SIGNAL, 0, &emsg);
    EINA_LIST_FOREACH(ed->subobjs, l, obj)