Accessibility: Re-apply stored name when recreating nodes in _ensure_node

When TabContainer calls accessibility_update_add_related_controls(), it
triggers _ensure_node() which creates a new AccessKit node. Since the
node pointer was nulled after the previous tree update push, this creates
an empty node without any properties.

TabBar only sets tab properties (name, bounds) when accessibility_item_dirty
is true. After initial setup, dirty=false, so recreated nodes would be
pushed without names, causing screen readers to announce "page tab" without
the tab name.

This fix re-applies the stored name (and name_extra_info) when _ensure_node
creates a new node, ensuring tab names persist across node recreations.
pull/113533/head
Nolan Darilek 2025-12-03 18:50:11 +07:00
parent fbc9539764
commit abf7b3c2ee
1 changed files with 7 additions and 0 deletions

@ -612,6 +612,13 @@ _FORCE_INLINE_ void AccessibilityDriverAccessKit::_ensure_node(const RID &p_id,
wd->update.insert(p_id);
p_ae->node = accesskit_node_new(p_ae->role);
// Re-apply stored name if any, so nodes recreated by _ensure_node
// retain their label even if the caller doesn't re-set all properties.
if (!p_ae->name.is_empty() || !p_ae->name_extra_info.is_empty()) {
String full_name = p_ae->name + " " + p_ae->name_extra_info;
accesskit_node_set_label(p_ae->node, full_name.utf8().ptr());
}
}
}