From 7df9cc1b470d889647fc03ac5a1989bf17a60fc6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 18 Jun 2023 18:57:02 -0400 Subject: [PATCH] label: Stop overriding accessible label There's no need to, the accessible name computation picks the content up where it is allowed (and not overridden by explicit attributes). --- gtk/gtkinscription.c | 5 ----- gtk/gtklabel.c | 4 ---- testsuite/a11y/label.c | 8 +++++--- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/gtk/gtkinscription.c b/gtk/gtkinscription.c index e01eff17f9..eba3246ef8 100644 --- a/gtk/gtkinscription.c +++ b/gtk/gtkinscription.c @@ -797,11 +797,6 @@ gtk_inscription_set_text (GtkInscription *self, g_free (self->text); self->text = g_strdup (text); - gtk_accessible_update_property (GTK_ACCESSIBLE (self), - GTK_ACCESSIBLE_PROPERTY_LABEL, self->text, - -1); - - pango_layout_set_text (self->layout, self->text ? self->text : "", -1); diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index d8741e8481..f223bae0d3 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -3067,10 +3067,6 @@ gtk_label_set_text_internal (GtkLabel *self, g_free (self->text); self->text = str; - gtk_accessible_update_property (GTK_ACCESSIBLE (self), - GTK_ACCESSIBLE_PROPERTY_LABEL, self->text, - -1); - gtk_label_select_region_index (self, 0, 0); } diff --git a/testsuite/a11y/label.c b/testsuite/a11y/label.c index 5b6814af49..f094b078f0 100644 --- a/testsuite/a11y/label.c +++ b/testsuite/a11y/label.c @@ -45,11 +45,13 @@ label_properties (void) g_object_ref_sink (label); - gtk_test_accessible_assert_property (label, GTK_ACCESSIBLE_PROPERTY_LABEL, "a"); + gtk_label_set_selectable (GTK_LABEL (label), TRUE); - gtk_label_set_label (GTK_LABEL (label), "b"); + gtk_test_accessible_assert_property (GTK_ACCESSIBLE (label), GTK_ACCESSIBLE_PROPERTY_HAS_POPUP, TRUE); - gtk_test_accessible_assert_property (label, GTK_ACCESSIBLE_PROPERTY_LABEL, "b"); + gtk_label_set_selectable (GTK_LABEL (label), FALSE); + + g_assert_false (gtk_test_accessible_has_property (GTK_ACCESSIBLE (label), GTK_ACCESSIBLE_PROPERTY_HAS_POPUP)); g_object_unref (label); }