After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 359843 - [a11y] "Look In Folder" Combo not getting reported by orca
[a11y] "Look In Folder" Combo not getting reported by orca
Status: VERIFIED FIXED
Product: atk
Classification: Platform
Component: gail
git master
Other All
: Normal normal
: ---
Assigned To: bill.haneman
bill.haneman
Depends on:
Blocks: 363244
 
 
Reported: 2006-10-05 10:34 UTC by Matt Keenan (IRC:MattMan)
Modified: 2006-11-16 17:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Untested patch to hopefully fix the problem. (1.28 KB, patch)
2006-10-08 20:38 UTC, Rich Burridge
none Details | Review
Patch (2.68 KB, patch)
2006-10-09 05:44 UTC, Dennis Cranston
none Details | Review
Ptach to gail to fix the problem (2.54 KB, patch)
2006-10-09 08:49 UTC, padraig.obriain
committed Details | Review

Description Matt Keenan (IRC:MattMan) 2006-10-05 10:34:49 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.
Comment 1 Tim Miao 2006-10-08 02:21:02 UTC
This bug can be reproduced with gnome2.16 on solaris vermillion_50.
Comment 2 Dennis Cranston 2006-10-08 05:43:25 UTC
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?
Comment 3 Dennis Cranston 2006-10-08 18:12:31 UTC
Reassigning to orca for now, but this may be a gtk+ issue.
Comment 4 Rich Burridge 2006-10-08 20:37:25 UTC
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.
Comment 5 Rich Burridge 2006-10-08 20:38:51 UTC
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?
Comment 6 Dennis Cranston 2006-10-08 23:59:08 UTC
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.
Comment 7 Rich Burridge 2006-10-09 00:14:00 UTC
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.

Comment 8 Rich Burridge 2006-10-09 00:34:00 UTC
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>

Comment 9 Rich Burridge 2006-10-09 03:05:00 UTC
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...
Comment 10 Dennis Cranston 2006-10-09 04:19:33 UTC
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.
Comment 11 Dennis Cranston 2006-10-09 05:44:35 UTC
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+.
Comment 12 padraig.obriain 2006-10-09 07:59:18 UTC
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.
Comment 13 padraig.obriain 2006-10-09 08:49:44 UTC
Created attachment 74332 [details] [review]
Ptach to gail to fix the problem
Comment 14 Rich Burridge 2006-11-16 17:57:50 UTC
Verified (against Ubuntu Edgy and gail from CVS HEAD).
Thanks Padraig!