int get_percent_value(double value, double lower, double upper);
Eina_Bool is_same_str (const char *s1, const char *s2);
+Eina_Bool rect_contains(const AtspiRect *rect, int x, int y);
Live_Region_Politeness try_parse_politeness(GHashTable *attrs, Eina_Bool assertive_by_default);
if (role != ATSPI_ROLE_POPUP_MENU && role != ATSPI_ROLE_DIALOG) { /* ctxpopup outline does not show highlight frame */
AtspiRect extents;
object_get_extents(obj, &extents);
- highlighted_object_x = extents.x + extents.width / 2;
- highlighted_object_y = extents.y + extents.height / 2;
+
+ if (rect_contains(&extents, nd->last_focus.x, nd->last_focus.y)) {
+ // If the last touched position is within the extents of the object,
+ // then use that position. (The center may be covered by some other object).
+ highlighted_object_x = nd->last_focus.x;
+ highlighted_object_y = nd->last_focus.y;
+ } else {
+ // Otherwise, use the center point.
+ highlighted_object_x = extents.x + extents.width / 2;
+ highlighted_object_y = extents.y + extents.height / 2;
+ }
}
keyboard_status = keyboard_event_status(nd->keyboard_tracker_data, info->resource_id);
if (val == APP_TRACKER_CONTEXT_NOT_VALID)
goto end;
+ nd->last_focus.x = info->x_beg;
+ nd->last_focus.y = info->y_beg;
_current_highlight_object_set(nd, obj, info->type == ONE_FINGER_SINGLE_TAP ? HIGHLIGHT_POINT_AGAIN : HIGHLIGHT_POINT);
}
end:
return !strncmp (s1, s2, l1);
}
+Eina_Bool rect_contains(const AtspiRect *rect, int x, int y)
+{
+ if (x < rect->x || x > (rect->x + rect->width))
+ return EINA_FALSE;
+
+ if (y < rect->y || y > (rect->y + rect->height))
+ return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
Live_Region_Politeness try_parse_politeness(GHashTable *attrs, Eina_Bool assertive_by_default)
{
Live_Region_Politeness mode = assertive_by_default ? ACCESSIBLE_LIVE_REGION_ASSERTIVE : ACCESSIBLE_LIVE_REGION_OFF;