GNOME Bugzilla – Bug 141437
GOK UI Grab to Swing combo-boxes fails
Last modified: 2004-12-22 21:47:04 UTC
1. Launch SwingSet2 with GOK running 2. Switch to the ComboBox panel 3. Select UI Grab 4. See "Philip", "Howard", and "Jeff" combo boxes, which appear on the GOK UI Grab keyboard. Selecting them from the UI Grab keyboard does nothing [BUG] --- 5. Launch gedit 6. Choose File->Open 7. Select UI Grab 8. See "All Files" and "Auto Detected" combo boxes, which appear on the GOK UI Grab keyboard. Selecting them from the UI Grab keyboard does nothing [BUG] -- 9. Still in gedit, choose Edit->Preferences 10. Choose Syntax Highlighting tab 11. Select UI Grab 12. See "Verilog" combo box, which appears on the GOK UI Grab keyboard. Selectign it DOES bring up a GOK Menu keyboard with the contents of that combo box, and selecting an item (e.g. "HTML") is successful [no bug]
The example which works is a GtkOptionMenu. The two which do not are GtkComboBox. I am closing as a duplicate of bug #136657. *** This bug has been marked as a duplicate of 136657 ***
Just a moment please - this bug notes problems in both GtkComboBox (a gail issue) and in Swing (perhaps a gnome-java-bridge issue; hopefully not a Swing issue). We should either re-title this bug to focus on the Java issue, or I can open a new one. But let's please not loose the Java issue.
Sorry about that. I have missed the Java problem. I do not know enough about gok to know what it is attempting to do here. What should gok do when the combo box is selected from the gok keyboard?
It should behave just as it does when selecting a standard menu (e.g. GOK->Menus brings up a keyboard listing the menus of the app; choose File and get a keyboard of the file menu items). So selecting a non-editable combo box should likewise display a keyboard with the menu items. When it is an editable combo box (where the user can type in an entry as well), then I believe the user should see an intermediate keyboard with two options - one would lead to the compose keyboard and the other to the menu keyboard). I leave it to Bill and/or David to confirm this latter situation.
What I am trying to get at is what at-spi call behaves differently when Java's combo box is not activated compared with when a combo-box is activated.
I have found that gok_spy_get_list_parent() returns NULL for Swing's ComboBox. I will dig further. I needed to fix bug #141537 as a recent change in gok requires it.
The problem seems to be that the children of the list have role LABEL. This explains why the combo box list items are not being displayed.
Created attachment 27704 [details] [review] Patch to display ComboBox items for Swing apps The reason that choosing a ComboBox item does not work is that gok calls AccessibleAction_doAction() to do it and as the object in question has role LABEL it does not implement AccessibleAction.
Nice one. Looks safe. If tests okay please commit.
The problem is that this patch does not fix the problem. It just allows the ComboBox items to be shown on the keyboard. Fixing the problem looks too difficult to me on a Friday afternoon.
I am not 100% sure about the patch, as ROLE_LABEL combo items seem pretty strange to me. If we get a combo-box-like object in future that has both list items and some sort of labelling widgets, this patch would cause trouble as it would result in the labels being included in the list of active items.
Bill, perhaps that case could be deterred by the HIG?
David: I am thinking about future combo-widget types, which would be presumably approved by the GNOME ui folks. I don't think the HIG would necessarily accept a guideline from us saying "combo boxes must not have non-list children".
OK. (-- and I wouldn't want to have to rely on folks following the HIG anyways) Agreed.
Where are we with this? Bill, can we live with the ROLE_LABEL combo items? I'm thinking we should ask Padraig to apply his patch and worry about that possible strangeness if/when it appears... So my vote is to apply (at this time).
As I noted above my patch does not fix the problem. It allows the items in the ComboBox to be displayed but they do not implement AccessibleAction so they cannot be activated.
OK, can someone try at-poke on the swing combobox items to see if they can be activated?
In Swing the comboxbox items do not support AcessibleAction.
So we need your patch + plus a Swing bug fix? Is there a bug filed?
Or should we be operating at the parent, combo-box level? Perhaps making use of: http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComboBox.html#setSelectedIndex(int) (indirectly of course) ??
The problem needs to be addressed in the JComboBox accessibility implementation. Closing as NOTGNOME (bug bugtraq bug needs to be filed; Peter will you do that please?)
There may be JComboBox bugs here, but J2SDK 1.5 (aka J2SDK 5.0) is frozen, and this is likely an API change that would have to wait for J2SDK 6.0 in ~2 years' time. The reason these objects have role LABEL is because that's what they are generally, unless they are checkboxes or radio buttons or other wierd things (which are allowed in menus), in which case that is the kind of thing they are. Given the Swing idioms, I don't think that should change. We implemented the AccessibleSelection interface on JComboBoxes, and if that interface fails (it seems to with at-poke and J2SDK 1.4.2), then that's a bug we can fix without an API change. Can GOK use the AccessibleSelection interface in this instance?
AccessibleSelection should work for us; reopening. It's not clear why GOK isn't already succeeding with AccessibleSelection, since it does attempt to expose selectable items in UI Grab.
Apologies for spam-- ensuring Sun a11y team are cc'ed on all current a11y bugs. Filter on "SUN A11Y SPAM" to ignore.
I have a partial fix. However there seems to be an underlying Swing bug that prevents it from fully working; it only works if the combobox is first manually popped down. Otherwise, though the combobox's list children are now found be GOK and selected, the selection-call on the parent list seems to have no effect on the comboboxes. If the combobox list is popped down, then the GOK select action works fine.
Comment on attachment 27704 [details] [review] Patch to display ComboBox items for Swing apps I don't like the addition of LABEL roles here, I believe it will break stuff. It also doesn't fully fix the bug.
Created attachment 33090 [details] [review] patch to check for ROLE_LIST and return it as the list container; and use selection interface when SELECTABLE is available.
Note that this patch only works when combos are posted before activating/selecting the list child. The remaining bug is NOTGNOME. I don't see a nice workaround either - synthesizing a spacebar event would be very nasty, and it would have to be toolkit-specific as well.
The patch reads okay. Will you be posting the NOTGNOME remainder bug somewhere? The key style checking is a bit messy but should work.
marking this bug NOTGNOME as the rest of the problem is outside our control. But the Gok-related problems are now fixed.