From 3a49ece9384ae78cac6d14542b50306f8f1a43f3 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 14 Mar 2019 05:34:39 +0100 Subject: [PATCH] eanble sending events from events --- lv_core/lv_obj.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lv_core/lv_obj.c b/lv_core/lv_obj.c index 52e3e64a6..c14cea6fb 100644 --- a/lv_core/lv_obj.c +++ b/lv_core/lv_obj.c @@ -1179,10 +1179,14 @@ lv_res_t lv_obj_send_event(lv_obj_t * obj, lv_event_t event) { if(obj == NULL) return LV_RES_OK; + /*If the event was send from an other event save the previous object to restore it at the end*/ + lv_obj_t * prev_obj_act_event = obj_act_event; obj_act_event = obj; + obj_act_event_deleted = false; if(obj->event_cb) obj->event_cb(obj, event); - obj_act_event = NULL; + + obj_act_event = prev_obj_act_event; /*Restore the previous "event object"*/ if(obj_act_event_deleted) return LV_RES_INV;