1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(event): fix lv_obj_clean not send event (#4902)

Signed-off-by: yushuailong1 <yushuailong1@xiaomi.com>
Co-authored-by: yushuailong1 <yushuailong1@xiaomi.com>
This commit is contained in:
fuxiujun 2023-11-30 21:32:48 +08:00 committed by GitHub
parent e06285e7a5
commit ba229b0708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,7 @@ void lv_obj_clean(lv_obj_t * obj)
lv_obj_invalidate(obj);
uint32_t cnt = lv_obj_get_child_count(obj);
lv_obj_t * child = lv_obj_get_first_not_deleting_child(obj);
while(child) {
obj_delete_core(child);
@ -112,6 +113,11 @@ void lv_obj_clean(lv_obj_t * obj)
obj->spec_attr->scroll.y = 0;
}
if(lv_obj_get_child_count(obj) < cnt) {
lv_obj_send_event(obj, LV_EVENT_CHILD_CHANGED, NULL);
lv_obj_send_event(obj, LV_EVENT_CHILD_DELETED, NULL);
}
LV_ASSERT_MEM_INTEGRITY();
LV_LOG_TRACE("finished (clean %p)", (void *)obj);