Hi All,This Gail patch fixes a few problems I've discovered with menus. It makes GailItem use gtk_label_get_text for the accessible name-- this gets rid of underscores showing up in Menu item names.
When creating a GailMenuItem, this patch sets the role of the AtkObject to ATK_ROLE_MENU when the corresponding GtkMenuItem has a submenu.
A more serious problem-- because menu items don't receive "real" GTK+ focus, Gail traps the select signal on menu items. The undesireable side affect of this is that when the open menus disappear, the AT client is not notified that the keyboard focus has returned to the widget which had it prior to the menus being posted. This problem can be illustrated by pressing f10 to post the menus, arrowing arround in the menus, and then pressing esc. to return to the widget having the focus prior to pressing f10. This patch attempts to fix this as follows:
1. When the widget receiving the "select" signal is a GtkMenuItem, and the widget known to currently have the "ATK" focus is not a GtkMenuItem, then I cache a copy of the item known to have focus. 2. I added a handler for "deactivate" signals on GtkmenuShell widgets. If the GtkMenuShell receiving the deactivate signal has no parent menu shell, meaning that it is the top level menubar, I fake an atk focus signal to the AtkObject representing the widget which I cached.
The only side affect I can see is that when a menu item is activated, and for example, brings up a dialog box, two ATK focus signals will be emitted-- one bringing ATK focus back to the widget having it before the menus were posted, and the second to the dialog. IMHO, this is much better than an AT getting lost when the menus disappear.
Marc
Attachment:
gail-menus.patch
Description: Binary data