GNOME Bugzilla – Bug 359843
[a11y] "Look In Folder" Combo not getting reported by orca
Last modified: 2006-11-16 17:57:50 UTC
Steps to reproduce: 1. Run orca. 2. Invoke Find File frame in launch bar Launch->Find Files... 3. Press Tab to move focus onto "Look in folder" combobox. Expected result: The name of combobox "Look in folder" can be reported by orca. Actual result: It was reported as "xx combobox" only. In my opinion, this is a bug in gnome-search-tool: it is not properly setting the labelled_by property of the "look in folder" combo box.
This bug can be reproduced with gnome2.16 on solaris vermillion_50.
gsearchtool.c: gsearch_app_create() contains the code: add_atk_namedesc (GTK_WIDGET (gsearch->look_in_folder_button), _("Look in folder"), _("Select the folder or device from which you want to begin the search.")); This code worked prior to the GNOME project switching to orca. Maybe this bug should to reassigned to orca product?
Reassigning to orca for now, but this may be a gtk+ issue.
No, it's a gsearchtool issue. You need to set up a "labelled-by" relationship to the "Look in Folder:" label. Untested patch to follow.
Created attachment 74314 [details] [review] Untested patch to hopefully fix the problem. Untesting because I don't currently have libgtop installed on my Solaris box. Dennis, could you give it a try please?
This patch seems like a lot of "code" just to support accessibility for a gtk-file-chooser-button. Maybe the gtk-file-chooser-button widget should contain this code instead? Then all applications that use the gtk-file-chooser-button would be accessible by default and not need to cut and paste this into their application.
I don't understand Dennis. The code I modified is in gsearchtool.c which is part of the gnome-utils module. How is this part of the gtk-file-chooser-button widget? If it was, wouldn't the code me in the Gtk+ module? Or are you saying that you deliberately had to cut and paste a chunk of the gtk-file-chooser widget code from Gtk+ in order to provide just this functionality. If so, perhaps you can point me at it. If that's the case, then I agree. The change is best done there.
Follow-on comment to my last one. I don't believe there is anything in the Gtk+ GUI API that exposes the setting of accessibility information at that level. It's all done at the atk level. Trying to get the Gtk+ folks to adjust their API(s) to accomodate setting of a11y info I think will be a non-starter. An alternive approach here would be to rework the searchtool GUI as a Glad file and load it. Latest Glade makes setting up accessibility relationships a snap. And it will be just 3 lines in the Glade XML file: Something like: <accessibility> <atkrelation target="speechSystemsLabel" type="labelled-by"/> </accessibility>
Having thought about this some more, I can see where an atk helper function might be useful. Something like: void set_label_relationship(GtkWidget *label, GtkWidget *widget) { GtkWidget *widget; GtkLabel *label; AtkObject *atk_widget, *atk_label; AtkRelationSet *relation_set; AtkRelation *relation; AtkObject *targets[1]; atk_widget = gtk_widget_get_accessible (widget); atk_label = gtk_widget_get_accessible (GTK_WIDGET (label)); relation_set = atk_object_ref_relation_set (atk_label); targets[0] = atk_widget; relation = atk_relation_new (targets, 1, ATK_RELATION_LABEL_FOR); atk_relation_set_add (relation_set, relation); g_object_unref (G_OBJECT (relation)); } See: http://developer.gnome.org/projects/gap/guide/gad/gad-api-examples.html for more details. Maybe it's worth filing a bug (enhancement request) against atk for this...
Sorry that my previous post was confusing Richard. To be honest this whole accessibility stuff confuses me, but I am trying to understand it. My main complaint is that it currently takes 10+ lines of code to get orca to report the gtk-file-chooser-button name as "Look in folder". The 10+ lines of code are confusing, and I wouldn't expect many GNOME programmers to get them right on their own. Adding the helper function from comment #9 to atk would certainly make accessibility coding easier for a developer. I do not know if it is possible, but I would prefer is to see this handled in gtk+. In other words, in gsearchtool.c when I call gtk_label_set_mnemonic_widget(label, button) it should automatically set labelled-by of button to be the text of label.
Created attachment 74327 [details] [review] Patch It would be better if the gsearchtool_set_label_relationship() function was either included in atk or was handled by gtk_label_set_mnemonic_widget() in gtk+.
There is code in gail which figures out labelled-by/label-for relations from mnemonic widgets. Currently the GtkFileChooserButton widget is labelled-by "Look in folder" label. I will see if I can make gail clever enough to put the labelled-by relation on the child ComboBox.
Created attachment 74332 [details] [review] Ptach to gail to fix the problem
Verified (against Ubuntu Edgy and gail from CVS HEAD). Thanks Padraig!