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);
AtspiComponent *comp = atspi_accessible_get_component_iface(obj);
AtspiRect *rect = atspi_component_get_extents(comp, ATSPI_COORD_TYPE_SCREEN, NULL);
- highlighted_object_x = rect->x + rect->width / 2;
- highlighted_object_y = rect->y + rect->height / 2;
+ if (rect_contains(rect, 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 = rect->x + rect->width / 2;
+ highlighted_object_y = rect->y + rect->height / 2;
+ }
g_boxed_free(ATSPI_TYPE_RECT, rect);
g_object_unref(comp);
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;