GNOME Bugzilla – Bug 509650
ATK_STATE_SHOWING state is not set properly on menu items
Last modified: 2009-07-29 03:57:39 UTC
Please describe the problem: The state ATK_STATE_SHOWING is described here: http://library.gnome.org/devel/atk/stable/atk-AtkState.html as "Indicates this object, the object's parent, the object's parent's parent, and so on, are all 'shown' to the end-user" In the case of the menus and menu items this is not work correctly. It is created initially in a correct way, but after being showed when a menu is open, then his state remain wrongly at SHOWING Steps to reproduce: I made this steps using dogtail on the application gcalctool, but any app with menus and submenus is enough: 1. Open an application with menus (ie: gcalctool) 2. Get the menu item copy, check if it is in showing state -> is FALSE 3. Open the Edit menu 4. Check the Copy menu item showing state -> is TRUE 5. Close the menus, so you can't see any menu on screen 6. Check the Copy menu item showing state Actual results: The menu item Copy is in state ATK_STATE_SHOWING Expected results: As the menu item Copy is not showed on screen, it shouldn't be on state ATK_STATE_SHOWING Does this happen every time? Yes Other information: I will update a little dogtail script in the next comment, that executes the steps on the bug description
Created attachment 102900 [details] A test dogtail python script that reproduces the error This is a little dogtail python script that reproduces the error. It uses gcalctool to reproduce the error, but any application with menus (at least the one I tested) have the same problem. (I choose gcalctool because it is small).
Created attachment 102901 [details] [review] Provisional patch Previously to conclude this state, it checks GTK_WIDGET_MAPPED and makes an additional check by search a GtkViewport and checking if the widget intersects with this gdkrectangle. This seems to not be enough. Following the ATK_STATE_SHOWING description, I simply follow the parent hierarchy, checking if it is on VISIBLE state or not, and added this requirement to the two previous.
I think it would be better if we check if the widget is mapped first for performance reason.
I mean, before gail_widget_all_parents_visible
(In reply to comment #3) > I think it would be better if we check if the widget is mapped first for > performance reason. (In reply to comment #4) > I mean, before gail_widget_all_parents_visible Yes, you are right, I will update the patch.
Created attachment 139152 [details] [review] Updating the last patch This patch is the same I uploaded on comment 2, but using the suggestions at comment 3 and comment 4. It also fix the comments that explains gail_widget_all_parents_visible, as in the other patch were incomplete. In the same way, this patch is against the gtk+ trunk, instead against gail, although the content is the same.