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

fix(indev): do no defocus if the same it object is clicked again

This commit is contained in:
Gabor Kiss-Vamosi 2023-08-10 07:52:17 +02:00
parent 9a15c1f9c5
commit 52caac9de3

View File

@ -1258,13 +1258,13 @@ static void indev_click_focus(lv_indev_t * indev)
} }
/*The object are not in group*/ /*The object are not in group*/
else { else {
if(indev->pointer.last_pressed) { if(indev->pointer.last_pressed != indev_obj_act) {
lv_obj_send_event(indev->pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act); lv_obj_send_event(indev->pointer.last_pressed, LV_EVENT_DEFOCUSED, indev_act);
if(indev_reset_check(indev)) return; if(indev_reset_check(indev)) return;
}
lv_obj_send_event(indev_obj_act, LV_EVENT_FOCUSED, indev_act); lv_obj_send_event(indev_obj_act, LV_EVENT_FOCUSED, indev_act);
if(indev_reset_check(indev)) return; if(indev_reset_check(indev)) return;
}
} }
} }
/*The object are not in the same group (in different groups or one has no group)*/ /*The object are not in the same group (in different groups or one has no group)*/