From 2f2cb76b3dd13d7dba9fd57538b763d9b5581b4c Mon Sep 17 00:00:00 2001 From: Radoslaw Cybulski Date: Wed, 3 Jul 2019 09:08:52 +0200 Subject: [PATCH] atspi: fixed invalid do action condition, added check to highlight grab Do gesture had invalid _is_object_permitted check, fixed. Highlight grab is now governed by call to accept_object, thus limiting objects, that might be highlighted to those, that might be tapped. @tizen_only Change-Id: I7ed979bba6178ad266daf9c93f681ec925936978 --- src/lib/elementary/elm_atspi_bridge.c | 53 +++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c index 1bfa6bf..b717126 100644 --- a/src/lib/elementary/elm_atspi_bridge.c +++ b/src/lib/elementary/elm_atspi_bridge.c @@ -175,6 +175,8 @@ static void _text_text_inserted_send(void *data, const Efl_Event *event); static void _text_text_removed_send(void *data, const Efl_Event *event); static void _text_caret_moved_send(void *data, const Efl_Event *event); static void _text_selection_changed_send(void *data, const Efl_Event *event); +static unsigned char accept_object(Eo *obj); + //TIZEN_ONLY(20160623): atspi: moved highlight when object is out of screen static void _move_outed_signal_send(void *data, const Efl_Event *event); // @@ -974,26 +976,27 @@ _accessible_gesture_do(const Eldbus_Service_Interface *iface, const Eldbus_Messa unsigned int event_time; Eldbus_Message *ret = NULL; Eina_Bool result = EINA_FALSE; - if (_is_operation_permitted(obj)) - { - if (!eldbus_message_arguments_get(msg, "iiiiiiu", &type, &x_beg, &y_beg, - &x_end, &y_end, &state, &event_time)) - return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type."); - - ret = eldbus_message_method_return_new(msg); - EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL); - - Efl_Access_Gesture_Info gesture_info; - gesture_info.type = (Efl_Access_Gesture)type; - gesture_info.x_beg = x_beg; - gesture_info.y_beg = y_beg; - gesture_info.x_end = x_end; - gesture_info.y_end = y_end; - gesture_info.state = (Efl_Access_Gesture_State)state; - gesture_info.event_time = event_time; - result = efl_access_object_gesture_do(obj, gesture_info); - eldbus_message_arguments_append(ret, "b", result); - } + if (!_is_operation_permitted(obj)) + return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Operation not permitted."); + + if (!eldbus_message_arguments_get(msg, "iiiiiiu", &type, &x_beg, &y_beg, + &x_end, &y_end, &state, &event_time)) + return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidArgs", "Invalid index type."); + + ret = eldbus_message_method_return_new(msg); + EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL); + + Efl_Access_Gesture_Info gesture_info; + gesture_info.type = (Efl_Access_Gesture)type; + gesture_info.x_beg = x_beg; + gesture_info.y_beg = y_beg; + gesture_info.x_end = x_end; + gesture_info.y_end = y_end; + gesture_info.state = (Efl_Access_Gesture_State)state; + gesture_info.event_time = event_time; + result = efl_access_object_gesture_do(obj, gesture_info); + eldbus_message_arguments_append(ret, "b", result); + return ret; } // @@ -5098,6 +5101,13 @@ accessibility_navigation_pointer_table_impl construct_accessibility_navigation_p table.bridge = bridge; return table; } + +static unsigned char accept_object(Eo *obj) +{ + accessibility_navigation_pointer_table_impl table = construct_accessibility_navigation_pointer_table(_instance); + return _accept_object(&table.ptrs, obj); +} + static Eo *_calculate_navigable_accessible_at_point(Eo *bridge, Eo *root, Eina_Bool coord_type, int x, int y) { accessibility_navigation_pointer_table_impl table = construct_accessibility_navigation_pointer_table(bridge); @@ -5276,7 +5286,8 @@ _component_grab_highlight(const Eldbus_Service_Interface *iface EINA_UNUSED, con ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, EFL_ACCESS_COMPONENT_MIXIN, msg); - highlight = efl_access_component_highlight_grab(obj); + if (accept_object(obj)) + highlight = efl_access_component_highlight_grab(obj); ret = eldbus_message_method_return_new(msg); EINA_SAFETY_ON_NULL_RETURN_VAL(ret, NULL); -- 2.7.4