From 19a6cff016d20c8527655d7999692826a74e4a5a Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 9 Jun 2021 13:34:01 +0200 Subject: [PATCH] fix(group) allow refocusing obejcts But do not send defocus event if the same obejct is refocused --- src/core/lv_group.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/lv_group.c b/src/core/lv_group.c index 5574e75c6..7a9a2c846 100644 --- a/src/core/lv_group.c +++ b/src/core/lv_group.c @@ -206,15 +206,13 @@ void lv_group_focus_obj(lv_obj_t * obj) if(g->frozen != 0) return; - if(g->obj_focus != NULL && obj == *g->obj_focus) return; - /*On defocus edit mode must be leaved*/ lv_group_set_editing(g, false); lv_obj_t ** i; _LV_LL_READ(&g->obj_ll, i) { if(*i == obj) { - if(g->obj_focus != NULL) { + if(g->obj_focus != NULL && obj != *g->obj_focus) { /*Do not defocus if the same object needs to be focused again*/ lv_res_t res = lv_event_send(*g->obj_focus, LV_EVENT_DEFOCUSED, get_indev(g)); if(res != LV_RES_OK) return; lv_obj_invalidate(*g->obj_focus);