From aada89335210ed2b09d8f956f7c6f4ec3b8a8bc8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 11 Jun 2023 12:37:06 -0400 Subject: [PATCH] passwordentry: Change an accessible role The caps-lock icon is really an alert. Maybe this is in vain, since orca ignores these images. --- gtk/gtkpasswordentry.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkpasswordentry.c b/gtk/gtkpasswordentry.c index 7cd496d45f..e88e2d14fe 100644 --- a/gtk/gtkpasswordentry.c +++ b/gtk/gtkpasswordentry.c @@ -208,7 +208,10 @@ gtk_password_entry_init (GtkPasswordEntry *entry) g_signal_connect_swapped (entry->entry, "notify::has-focus", G_CALLBACK (focus_changed), entry); g_signal_connect_swapped (entry->entry, "activate", G_CALLBACK (activate_cb), entry); - entry->icon = gtk_image_new_from_icon_name ("caps-lock-symbolic"); + entry->icon = g_object_new (GTK_TYPE_IMAGE, + "icon-name", "caps-lock-symbolic", + "accessible-role", GTK_ACCESSIBLE_ROLE_ALERT, + NULL); gtk_widget_set_tooltip_text (entry->icon, _("Caps Lock is on")); gtk_widget_add_css_class (entry->icon, "caps-lock-indicator"); gtk_widget_set_cursor (entry->icon, gtk_widget_get_cursor (entry->entry)); -- 2.30.2