edje: fix bug when using filter with edje cache turned on.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 20 Nov 2011 18:27:14 +0000 (18:27 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 20 Nov 2011 18:27:14 +0000 (18:27 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@65458 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_program.c

index 931977c..bd18234 100644 (file)
@@ -1029,10 +1029,6 @@ static Eina_Bool _edje_glob_callback(Edje_Program *pr, void *dt)
    Edje_Real_Part *rp = NULL;
    Eina_Bool exec = EINA_TRUE;
 
-#ifdef EDJE_PROGRAM_CACHE
-   data->matched++;
-#endif
-
    if (pr->filter.state)
      {
        rp = _edje_real_part_get(data->ed, pr->filter.part ? pr->filter.part : data->source);
@@ -1040,6 +1036,10 @@ static Eina_Bool _edje_glob_callback(Edje_Program *pr, void *dt)
          exec = (rp->chosen_description->state.name == pr->filter.state);
      }
 
+#ifdef EDJE_PROGRAM_CACHE
+   data->matched++;
+#endif
+
    if (exec)
      _edje_program_run(data->ed, pr, 0, data->signal, data->source);
 
@@ -1139,11 +1139,25 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src,
               {
                 EINA_LIST_FOREACH(matches, l, pr)
                    {
-                      _edje_program_run(ed, pr, 0, sig, src);
-                      if (_edje_block_break(ed))
-                        {
-                           goto break_prog;
-                        }
+                       Eina_Bool exec = EINA_TRUE;
+
+                       if (pr->filter.state)
+                         {
+                            Edje_Real_Part *rp;
+
+                            rp = _edje_real_part_get(ed, pr->filter.part ? pr->filter.part : src);
+                            if (rp)
+                              exec = (rp->chosen_description->state.name == pr->filter.state);
+                         }
+
+                       if (exec)
+                         {
+                            _edje_program_run(ed, pr, 0, sig, src);
+                            if (_edje_block_break(ed))
+                              {
+                                 goto break_prog;
+                              }
+                         }
                    }
                  done = 1;
               }