diff --git a/lv_core/lv_core.mk b/lv_core/lv_core.mk index ac69f25e3..daf6b33b1 100644 --- a/lv_core/lv_core.mk +++ b/lv_core/lv_core.mk @@ -4,7 +4,6 @@ CSRCS += lv_disp.c CSRCS += lv_obj.c CSRCS += lv_refr.c CSRCS += lv_style.c -CSRCS += lv_lang.c DEPPATH += --dep-path $(LVGL_DIR)/lvgl/lv_core VPATH += :$(LVGL_DIR)/lvgl/lv_core diff --git a/lv_core/lv_indev.c b/lv_core/lv_indev.c index 76a302fb2..3dd842bf7 100644 --- a/lv_core/lv_indev.c +++ b/lv_core/lv_indev.c @@ -675,6 +675,7 @@ static void indev_proc_press(lv_indev_proc_t * proc) /*If a new object found the previous was lost, so send a signal*/ if(proc->types.pointer.act_obj != NULL) { proc->types.pointer.act_obj->signal_cb(proc->types.pointer.act_obj, LV_SIGNAL_PRESS_LOST, indev_act); + if(proc->reset_query) return; /*The object might be deleted*/ lv_obj_send_event(proc->types.pointer.act_obj, LV_EVENT_PRESS_LOST); if(proc->reset_query) return; /*The object might be deleted*/ } @@ -712,6 +713,7 @@ static void indev_proc_press(lv_indev_proc_t * proc) /*Send a signal about the press*/ proc->types.pointer.act_obj->signal_cb(proc->types.pointer.act_obj, LV_SIGNAL_PRESSED, indev_act); + if(proc->reset_query) return; /*The object might be deleted*/ lv_obj_send_event(proc->types.pointer.act_obj, LV_EVENT_PRESSED); if(proc->reset_query) return; /*The object might be deleted*/ } @@ -736,6 +738,7 @@ static void indev_proc_press(lv_indev_proc_t * proc) /*If there is active object and it can be dragged run the drag*/ if(proc->types.pointer.act_obj != NULL) { proc->types.pointer.act_obj->signal_cb(proc->types.pointer.act_obj, LV_SIGNAL_PRESSING, indev_act); + if(proc->reset_query) return; /*The object might be deleted*/ lv_obj_send_event(proc->types.pointer.act_obj, LV_EVENT_PRESSING); if(proc->reset_query) return; /*The object might be deleted*/ @@ -747,6 +750,7 @@ static void indev_proc_press(lv_indev_proc_t * proc) /*Send a signal about the long press if enough time elapsed*/ if(lv_tick_elaps(proc->pr_timestamp) > LV_INDEV_LONG_PRESS_TIME) { pr_obj->signal_cb(pr_obj, LV_SIGNAL_LONG_PRESS, indev_act); + if(proc->reset_query) return; /*The object might be deleted*/ lv_obj_send_event(pr_obj, LV_EVENT_LONG_PRESSED); if(proc->reset_query) return; /*The object might be deleted*/ @@ -762,6 +766,7 @@ static void indev_proc_press(lv_indev_proc_t * proc) /*Send a signal about the long press repeate if enough time elapsed*/ if(lv_tick_elaps(proc->longpr_rep_timestamp) > LV_INDEV_LONG_PRESS_REP_TIME) { pr_obj->signal_cb(pr_obj, LV_SIGNAL_LONG_PRESS_REP, indev_act); + if(proc->reset_query) return; /*The object might be deleted*/ lv_obj_send_event(pr_obj, LV_EVENT_LONG_PRESSED_REPEAT); if(proc->reset_query) return; /*The object might be deleted*/ proc->longpr_rep_timestamp = lv_tick_get(); @@ -792,6 +797,8 @@ static void indev_proc_release(lv_indev_proc_t * proc) * In this case send the `LV_SIGNAL_RELEASED/CLICKED` instead of `LV_SIGNAL_PRESS_LOST` if the indev is ON the `types.pointer.act_obj` */ if(lv_obj_is_protected(proc->types.pointer.act_obj, LV_PROTECT_PRESS_LOST)) { proc->types.pointer.act_obj->signal_cb(proc->types.pointer.act_obj, LV_SIGNAL_RELEASED, indev_act); + if(proc->reset_query) return; /*The object might be deleted*/ + if(proc->long_pr_sent == 0 && proc->types.pointer.drag_in_prog == 0) { lv_obj_send_event(proc->types.pointer.act_obj, LV_EVENT_SHORT_CLICKED); if(proc->reset_query) return; /*The object might be deleted*/ @@ -807,6 +814,7 @@ static void indev_proc_release(lv_indev_proc_t * proc) * If it is already not pressed then was `indev_proc_press` would set `act_obj = NULL`*/ else { proc->types.pointer.act_obj->signal_cb(proc->types.pointer.act_obj, LV_SIGNAL_RELEASED, indev_act); + if(proc->reset_query) return; /*The object might be deleted*/ if(proc->long_pr_sent == 0 && proc->types.pointer.drag_in_prog == 0) { lv_obj_send_event(proc->types.pointer.act_obj, LV_EVENT_SHORT_CLICKED); @@ -999,7 +1007,6 @@ static void indev_drag(lv_indev_proc_t * state) if(drag_obj->coords.x1 != prev_x || drag_obj->coords.y1 != prev_y) { if(state->types.pointer.drag_in_prog != 0) { /*Send the drag begin signal on first move*/ drag_obj->signal_cb(drag_obj, LV_SIGNAL_DRAG_BEGIN, indev_act); - if(state->reset_query != 0) return; } state->types.pointer.drag_in_prog = 1; @@ -1073,6 +1080,7 @@ static void indev_drag_throw(lv_indev_proc_t * proc) proc->types.pointer.drag_throw_vect.x = 0; proc->types.pointer.drag_throw_vect.y = 0; drag_obj->signal_cb(drag_obj, LV_SIGNAL_DRAG_END, indev_act); + if(proc->reset_query) return; /*The object might be deleted*/ } } @@ -1080,6 +1088,7 @@ static void indev_drag_throw(lv_indev_proc_t * proc) else { proc->types.pointer.drag_in_prog = 0; drag_obj->signal_cb(drag_obj, LV_SIGNAL_DRAG_END, indev_act); + if(proc->reset_query) return; /*The object might be deleted*/ } } diff --git a/lv_misc/lv_misc.mk b/lv_misc/lv_misc.mk index 470f1230d..ad553d2ed 100644 --- a/lv_misc/lv_misc.mk +++ b/lv_misc/lv_misc.mk @@ -8,7 +8,6 @@ CSRCS += lv_mem.c CSRCS += lv_ll.c CSRCS += lv_color.c CSRCS += lv_txt.c -CSRCS += lv_ufs.c CSRCS += lv_math.c CSRCS += lv_log.c CSRCS += lv_gc.c diff --git a/lv_objx/lv_cont.c b/lv_objx/lv_cont.c index 81fb4e3fe..fcfddd642 100644 --- a/lv_objx/lv_cont.c +++ b/lv_objx/lv_cont.c @@ -623,7 +623,7 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) lv_area_t tight_area; lv_area_t ori; lv_style_t * style = lv_obj_get_style(cont); - lv_obj_t * i; + lv_obj_t * child_i; lv_coord_t hpad = style->body.padding.hor; lv_coord_t vpad = style->body.padding.ver; @@ -648,12 +648,12 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) tight_area.x2 = LV_COORD_MIN; tight_area.y2 = LV_COORD_MIN; - LV_LL_READ(cont->child_ll, i) { - if(lv_obj_get_hidden(i) != false) continue; - tight_area.x1 = LV_MATH_MIN(tight_area.x1, i->coords.x1); - tight_area.y1 = LV_MATH_MIN(tight_area.y1, i->coords.y1); - tight_area.x2 = LV_MATH_MAX(tight_area.x2, i->coords.x2); - tight_area.y2 = LV_MATH_MAX(tight_area.y2, i->coords.y2); + LV_LL_READ(cont->child_ll, child_i) { + if(lv_obj_get_hidden(child_i) != false) continue; + tight_area.x1 = LV_MATH_MIN(tight_area.x1, child_i->coords.x1); + tight_area.y1 = LV_MATH_MIN(tight_area.y1, child_i->coords.y1); + tight_area.x2 = LV_MATH_MAX(tight_area.x2, child_i->coords.x2); + tight_area.y2 = LV_MATH_MAX(tight_area.y2, child_i->coords.y2); } tight_area.x1 -= hpad; @@ -708,13 +708,11 @@ static void lv_cont_refr_autofit(lv_obj_t * cont) cont->signal_cb(cont, LV_SIGNAL_CORD_CHG, &ori); /*Inform the parent about the new coordinates*/ - lv_obj_t * par = lv_obj_get_parent(cont); par->signal_cb(par, LV_SIGNAL_CHILD_CHG, cont); /*Tell the children the parent's size has changed*/ - lv_obj_t * i; - LV_LL_READ(cont->child_ll, i) { - i->signal_cb(i, LV_SIGNAL_PARENT_SIZE_CHG, NULL); + LV_LL_READ(cont->child_ll, child_i) { + child_i->signal_cb(child_i, LV_SIGNAL_PARENT_SIZE_CHG, NULL); } } diff --git a/lv_objx/lv_ddlist.c b/lv_objx/lv_ddlist.c index 974f811b0..8ea3d50d8 100644 --- a/lv_objx/lv_ddlist.c +++ b/lv_objx/lv_ddlist.c @@ -691,7 +691,7 @@ static lv_res_t lv_ddlist_signal(lv_obj_t * ddlist, lv_signal_t sign, void * par if(ext->opened) { ext->sel_opt_id_ori = ext->sel_opt_id; ext->opened = 0; - lv_res_t res = lv_obj_send_event(ddlist, LV_EVENT_VALUE_CHANGED); + res = lv_obj_send_event(ddlist, LV_EVENT_VALUE_CHANGED); if(res != LV_RES_OK) return res; #if LV_USE_GROUP lv_group_t * g = lv_obj_get_group(ddlist); diff --git a/lv_objx/lv_ta.c b/lv_objx/lv_ta.c index 9c3e35747..5b76c1ada 100644 --- a/lv_objx/lv_ta.c +++ b/lv_objx/lv_ta.c @@ -1223,8 +1223,6 @@ static lv_res_t lv_ta_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void if(lv_obj_get_width(ta) != lv_area_get_width(param) || lv_obj_get_height(ta) != lv_area_get_height(param)) { - lv_obj_t * scrl = lv_page_get_scrl(ta); - lv_style_t * style_scrl = lv_obj_get_style(scrl); lv_obj_set_width(ext->label, lv_obj_get_width(scrl) - 2 * style_scrl->body.padding.hor); lv_obj_set_pos(ext->label, style_scrl->body.padding.hor, style_scrl->body.padding.ver);