GNOME Bugzilla – Bug 355005
Accessibility problems with themed greeters
Last modified: 2007-06-27 02:31:23 UTC
The Circles and Happy GNOME themes for the gdm greeter have accessibility problems. More specifically, the username/password text field does not have the ATK "labelled by" relation making it difficult for a screen reader to announce the purpose of the text box to a blind user. The plain, unthemed greeter correctly provides this relation. But since picking an login theme requires admin priviledges, switching to the plain greeter is not a solution for unpriviledged users. Contact me if you need help using ATK to correct this problem.
On second look, this probably a problem with the theme, but with the gdmgreeter application. The gdmlogin app has the desired atk label relations whereas the gdmgreeter does not. Fixing this bug in one place should improve accessibility for all themed login screens.
I'm glad to hear that gdmgreeter works so well. As the documentation in GDM mentions, only gdmlogin has received a11y focus so far. I'd be happy to help. Note that in greeter_canvas_item.c that we do call gtk_widget_set_name on the entry field, setting the name to "user-pw-entry". Shouldn't this set the name of the field? Looking at the unthemed greeter (gdmlogin), I don't see where we are setting the name of the entry field anywhere, so I'm unsure how this is getting set. Any ideas? What label are you seeing in gdmlogin?
Hi Brian, The accessible name of the text entry field isn't getting set in gdmlogin. ATK relations (ATK_RELATION_LABEL_FOR and ATK_RELATION_LABELLED_BY) are being used to connect the unnamed text box with its appropriate label widget and vice versa. This is a fine approach and should be mimicked in gdmgreeter. As far as using gtk_widget_set_name is concerned, I'm not sure if using the gtk_widget_set_name call properly sets the accessible name. Instead, you might have to do a gtk_get_accessible followed by a atk_object_set_name on the result. Still, the first approach, using the accessible relation, is preferred.
I'm not sure how this relation is set in gdmlogin. Could you explain so I could make the code in gdmgreeter mimic this?
It looks like there is no explicit atk code in gdmlogin.c at present relating the label to the username/password entry field. What I believe is happening is that gail (the library that provides basic accessibility for gtk widgets) is automatically associating the label to the entry field because they are attached next to one another in a gtk table layout. I don't believe this is the case in gdmgreeter. To make this relation explicit, you need to add code like the following: AtkObject *entryAcc, *labelAcc; entryAcc = gtk_widget_get_accessible(entry); labelAcc = gtk_widget_get_accessible(label); atk_object_add_relationship(labelAcc, ATK_RELATION_LABEL_FOR, entryAcc); atk_object_add_relationship(entryAcc, ATK_RELATION_LABELLED_BY, labelAcc); where entry and label are the gtk widgets for the username/password text field and its associated label respectively. See "3. Label widgets by establishing a relationship" in the below referenced Guidelines for Writing Accessible GNOME Applications Using GTK+ and the Accessibility Toolkit (ATK) for more details. http://accessibility.freestandards.org/~gk4/a11y/ddc06/guide/atkguideddc06.html#htmlcat_ibmgapguidegtkatk.html__Toc412398981
Created attachment 74904 [details] [review] patch that doesn't work Thanks. I tried the code you suggest (linking the password entry with the user-pw-entry label), but the code seems to coredump in the call to gtk_widget_get_accessible (label) call. It crashes on this line in the function: 7828 g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); I'm not sure what the problem is here. Note we are using GnomeCanvas Text items for the labels in gdmgreeter. Perhaps it isn't really using a GtkWidget, or perhaps it isn't initialized properly at the time of the call? Ideas of what the problem might be, or how to work around this? I attached the patch I am using that is causing core dumping problems.
Note bug #355005, bug #363003, and bug #380575 are all related to gdmgreeter accessibility issues. Perhaps an idea would be to add a hotkey to allow users to swtich from gdmgreeter to gdmlogin if the user has an a11y need that is not met by gdmgreeter but is met by gdmlogin?
I'm not an expert on using atk from C. Both of the problems you suggest seem possible. The best person to ask would be Bill Hanneman at Sun. As far as a key to switch greeters, I think you need to ask the community on the accessibility-developers-list for some feedback on the idea. It seems like it would work, but it feels like it's skirting the real problem which should be fixable.
Hi Brian; are you sure the coredump isn't here: + GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget; + GtkWidget *label = GNOME_CANVAS_WIDGET (conversation_info->item)->widget; I suspect you're right about these objects not necessarily being GtkWidgets. If they aren't GtkWidgets then they need their own ATK implementations (c.f. gail), and a different API needs to be used to obtain the AtkObject peer - probably calling the factory directly to construct the AtkObject rather than using gtk_widget_get_accessible.
I added the bit of your patch that sets the ATK name for the entry field to be the pam-prompt string. Might be nicer to set LABEL_FOR, LABELLED_BY flags instead between the label and the entry field, but that will require rewriting the way label widgets are managed in gdmgreeter. For now, this makes things work better.
Note this is related to bug #412576, where I got the patch I applied to fix the setting name for the entry field.
I'm closing this bug since I think the patch from bug 412576 fixes this issue.