Skip to content

a11y: Update label's accessible name on text update

Update the GTK_ACCESSIBLE_PROPERTY_LABEL property in gtk_label_set_text_internal using the new text instead of using the label in gtk_label_set_label_internal.

While the label "includes any embedded underlines indicating mnemonics and Pango markup" [1], the text is the "text is as it appears on screen" [2], which is more suitable for the accessible name.

With this in place, the label is reported as the accessible name again after

commit d5b34aecdd10e0c6c2fb6fe8043c7121ecc480b4
Date:   Wed Jan 17 12:49:38 2024 +0100

    a11y: Remove special handling of accessible names for static text widgets

[1] https://docs.gtk.org/gtk4/method.Label.get_label.html [2] https://docs.gtk.org/gtk4/method.Label.get_text.html

Fixes: #6732 (closed) Fixes: #6735 (closed)

Edited by Michael Weghorn

Merge request reports