summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-11-09 14:06:39 +0000
committerTom Hacohen <tom@stosb.com>2015-11-09 14:06:39 +0000
commite992a3a1e0b597fecbe4b935659138d6a9bafcf2 (patch)
tree495f6e9d70a859c18e7c73a1461c364e923b52ac
parent4b116627c24a43248abf5a34a391241b1c0cf983 (diff)
Revert "Eo: Optimise event callback call"
This reverts commit 4b116627c24a43248abf5a34a391241b1c0cf983. This can't be done, because the freeze state can change from within the callbacks so you need to check if events are frozen every time.
-rw-r--r--src/lib/eo/eo_base_class.c53
1 files changed, 28 insertions, 25 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index daf7a9d277..f99ca37289 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -671,45 +671,48 @@ _eo_base_event_callback_call(Eo *obj_id, Eo_Base_Data *pd,
671 671
672 pd->walking_list++; 672 pd->walking_list++;
673 673
674 if (!desc->unfreezable && (event_freeze_count || pd->event_freeze_count))
675 goto end;
676
677 for (cb = pd->callbacks; cb; cb = cb->next) 674 for (cb = pd->callbacks; cb; cb = cb->next)
678 { 675 {
679 if (cb->delete_me) 676 if (!cb->delete_me)
680 continue;
681
682 if (cb->func_array)
683 { 677 {
684 const Eo_Callback_Array_Item *it; 678 if (cb->func_array)
679 {
680 const Eo_Callback_Array_Item *it;
685 681
686 for (it = cb->items.item_array; it->func; it++) 682 for (it = cb->items.item_array; it->func; it++)
683 {
684 if (!_cb_desc_match(it->desc, desc))
685 continue;
686 if (!it->desc->unfreezable &&
687 (event_freeze_count || pd->event_freeze_count))
688 continue;
689
690 /* Abort callback calling if the func says so. */
691 if (!it->func((void *) cb->func_data, obj_id, desc,
692 (void *) event_info))
693 {
694 ret = EINA_FALSE;
695 goto end;
696 }
697 }
698 }
699 else
687 { 700 {
688 if (!_cb_desc_match(it->desc, desc)) 701 if (!_cb_desc_match(cb->items.item.desc, desc))
702 continue;
703 if (!cb->items.item.desc->unfreezable &&
704 (event_freeze_count || pd->event_freeze_count))
689 continue; 705 continue;
690 706
691 /* Abort callback calling if the func says so. */ 707 /* Abort callback calling if the func says so. */
692 if (!it->func((void *) cb->func_data, obj_id, desc, 708 if (!cb->items.item.func((void *) cb->func_data, obj_id, desc,
693 (void *) event_info)) 709 (void *) event_info))
694 { 710 {
695 ret = EINA_FALSE; 711 ret = EINA_FALSE;
696 goto end; 712 goto end;
697 } 713 }
698 } 714 }
699 } 715 }
700 else
701 {
702 if (!_cb_desc_match(cb->items.item.desc, desc))
703 continue;
704
705 /* Abort callback calling if the func says so. */
706 if (!cb->items.item.func((void *) cb->func_data, obj_id, desc,
707 (void *) event_info))
708 {
709 ret = EINA_FALSE;
710 goto end;
711 }
712 }
713 } 716 }
714 717
715end: 718end: