From 494461315299d6670105807443f8bd729327f647 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 10 Mar 2020 18:29:41 +0100 Subject: [PATCH] indev: imrove handling of disabled obejcts --- src/lv_core/lv_indev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index d269aa19d..45bbcb699 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -780,6 +780,11 @@ static void indev_proc_press(lv_indev_proc_t * proc) indev_drag_throw(proc); } + /*Do not use disabled objects*/ + if((lv_obj_get_state(indev_obj_act, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED)) { + indev_obj_act = proc->types.pointer.act_obj; + } + /*If a new object was found reset some variables and send a pressed signal*/ if(indev_obj_act != proc->types.pointer.act_obj) { proc->types.pointer.last_point.x = proc->types.pointer.act_point.x; @@ -1044,8 +1049,7 @@ lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point) /*If then the children was not ok, and this obj is clickable * and it or its parent is not hidden then save this object*/ - if(found_p == NULL && lv_obj_get_click(obj) != false && - (lv_obj_get_state(obj, LV_OBJ_PART_MAIN) & LV_STATE_DISABLED) == 0) { + if(found_p == NULL && lv_obj_get_click(obj) != false) { lv_obj_t * hidden_i = obj; while(hidden_i != NULL) { if(lv_obj_get_hidden(hidden_i) == true) break;