From a2ad1a7a9cd3e608f3fb4e5a694540a9cfef9c69 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 18 Oct 2026 23:54:06 +0100 Subject: Size to the module what is the module's (Pure 027's 4f-3a): timers grow to its inputs, the focus marks to its views, the accessibility tree's children to their count; a table shows its first VEGA_COLUMNS (64) columns, Vega's own count --- surfaces/access.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'surfaces/access.c') diff --git a/surfaces/access.c b/surfaces/access.c index 24e3d00..a0255f3 100644 --- a/surfaces/access.c +++ b/surfaces/access.c @@ -162,13 +162,16 @@ static Object parent_of(const Object *o) { } static size_t index_in_parent(const VegaAccess *a, const Object *o) { - Object parent = parent_of(o), kids[VEGA_PARTS + PURE_MODULE_INPUTS + 4]; + Object parent = parent_of(o); if (o->kind == ROW) return o->row; if (o->kind == CELL) return o->column; - size_t n = children(a, &parent, kids, sizeof(kids) / sizeof(*kids)); - for (size_t i = 0; i < n && i < sizeof(kids) / sizeof(*kids); ++i) - if (kids[i].kind == o->kind && kids[i].part == o->part && kids[i].key == o->key) return i; - return 0; + size_t n = children(a, &parent, NULL, 0), at = 0; + Object *kids = malloc((n + 1) * sizeof(*kids)); + if (kids) n = children(a, &parent, kids, n); + for (size_t i = 0; kids && i < n; ++i) + if (kids[i].kind == o->kind && kids[i].part == o->part && kids[i].key == o->key) { at = i; break; } + free(kids); + return at; } static int role_of(const VegaAccess *a, const Object *o) { -- cgit v1.2.3