diff --git a/CHANGELOG.md b/CHANGELOG.md index 47bc0f662..c48a278e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Fix copying base dir in `lv_obj_create` - Handle sub pixel rendering in font loader - Fix transitions with style caching +- Fix click focus ## v7.6.0 (22.09.2020) diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index 6b8f2e46c..16aa34529 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -1162,14 +1162,14 @@ static void indev_click_focus(lv_indev_proc_t * proc) if(lv_obj_is_protected(indev_obj_act, LV_PROTECT_CLICK_FOCUS) == false && proc->types.pointer.last_pressed != obj_to_focus) { #if LV_USE_GROUP - lv_group_t * g_act = lv_obj_get_group(indev_obj_act); + lv_group_t * g_act = lv_obj_get_group(obj_to_focus); lv_group_t * g_prev = proc->types.pointer.last_pressed ? lv_obj_get_group(proc->types.pointer.last_pressed) : NULL; /*If both the last and act. obj. are in the same group (or no group but it's also the same) */ if(g_act == g_prev) { /*The objects are in a group*/ if(g_act) { - lv_group_focus_obj(indev_obj_act); + lv_group_focus_obj(obj_to_focus); if(indev_reset_check(proc)) return; } /*The object are not in group*/ @@ -1218,7 +1218,7 @@ static void indev_click_focus(lv_indev_proc_t * proc) /*Focus to the act. in its group*/ if(g_act) { - lv_group_focus_obj(indev_obj_act); + lv_group_focus_obj(obj_to_focus); if(indev_reset_check(proc)) return; } else { @@ -1236,9 +1236,9 @@ static void indev_click_focus(lv_indev_proc_t * proc) if(indev_reset_check(proc)) return; } - lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL); + lv_signal_send(obj_to_focus, LV_SIGNAL_FOCUS, NULL); if(indev_reset_check(proc)) return; - lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL); + lv_event_send(obj_to_focus, LV_EVENT_FOCUSED, NULL); if(indev_reset_check(proc)) return; #endif proc->types.pointer.last_pressed = obj_to_focus;