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

indev: imrove handling of disabled obejcts

This commit is contained in:
Gabor Kiss-Vamosi 2020-03-10 18:29:41 +01:00
parent cd85d96fca
commit 4944613152

View File

@ -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;