GNOME Bugzilla – Bug 371412
GAIL: Problem with atached menus to widget
Last modified: 2007-01-03 17:11:20 UTC
Please describe the problem: Menus(GtkMenu widget) attached to some widget(GtkWidget, GtkMenuItem, etc) by the gtk_menu_attach_to_widget function are not being seen by AT-SPI. It is not possible to access to these menus by AT-SPI. So I started to analyze the source of GAIL and I found a reason. It is is_attached_menu_window function in gail/gailtoplevel.c, which returns TRUE if menus are attached to button, menu itam or opction menu. Next gail_toplevel_show_event_watcher function doesn't implement toplevel objects if these objects own menu child attached to button, menu itam or opction menu. So could someone explain me what for the with is_attached_menu_window function was added to the GAIL implementation? Because the one reason I can see it is unvisibility of these menus in AT-SPI. Steps to reproduce: 1. Write a simple program with Gtk+, which contains an attached menu to some widget (e.g. GtkButton) by gtk_menu_attach_to_widget function. 2. Compile and run this program, next popup the attached menu. 3. Try to access to the menu using at-spi. Actual results: The menu is not being seen by at-spi. Expected results: The menu should be able in at-spi. Does this happen every time? Yes, it does. Other information: By analyzing the source of GAIL, I found a reason of this sytuation. It is is_attached_menu_window function in gail/gailtoplevel.c, which returns TRUE if menus are attached to button, menu itam or opction menu. Next gail_toplevel_show_event_watcher function doesn't implement toplevel objects if these objects own menu child attached to button, menu itam or opction menu. What for the is_attached_menu_window function is implemented in gail and what for is checked if menu is attached to some widget?
Created attachment 76070 [details] A small test program which illustrates the problem
Sorry for duplicate some information in the raport of the bug.
is_attached_menu_window is there to prevent menus which are actually attached to menus from being seen _twice_ in at-spi; that is, such windows should NOT be exposed as "toplevels". So your problem appears not to be with is_attached_menu_window, but rather the question is why the menu is not appearing as a child of the widget to which it is attached...
I supposed that is_attached_menu_window makes sense, but I could guess how. So thanks for the explanation. But the problem still exists, the attached menus are not being seen in at-spi. Where is the problem, in gtk+ or atk/gail, or maybe in my program?
Created attachment 78187 [details] [review] The patch resolve problems with attached menus to GtkButton
So, the patch fix the problem of menu attached to GtkButton? And there are still problems with menu item or option menu?
The patch fixes only the problem of menu attached to GtkButton. I haven't checked what happen with menu attached to menu item and option menu. You must do it by yourself.
Thanks Marcin!