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 509650 - ATK_STATE_SHOWING state is not set properly on menu items
ATK_STATE_SHOWING state is not set properly on menu items
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: gail
git master
Other All
: High normal
: ---
Assigned To: Li Yuan
Li Yuan
Depends on:
Blocks:
 
 
Reported: 2008-01-15 14:22 UTC by Alejandro Piñeiro Iglesias (IRC: infapi00)
Modified: 2009-07-29 03:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A test dogtail python script that reproduces the error (670 bytes, application/octet-stream)
2008-01-15 14:24 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
  Details
Provisional patch (1.59 KB, patch)
2008-01-15 14:39 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
none Details | Review
Updating the last patch (2.03 KB, patch)
2009-07-24 13:30 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
committed Details | Review

Description Alejandro Piñeiro Iglesias (IRC: infapi00) 2008-01-15 14:22:19 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
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2008-01-15 14:24:42 UTC
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).
Comment 2 Alejandro Piñeiro Iglesias (IRC: infapi00) 2008-01-15 14:39:40 UTC
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.
Comment 3 Li Yuan 2009-07-24 08:45:13 UTC
I think it would be better if we check if the widget is mapped first for performance reason.
Comment 4 Li Yuan 2009-07-24 08:46:28 UTC
I mean, before gail_widget_all_parents_visible
Comment 5 Alejandro Piñeiro Iglesias (IRC: infapi00) 2009-07-24 12:45:01 UTC
(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.

Comment 6 Alejandro Piñeiro Iglesias (IRC: infapi00) 2009-07-24 13:30:52 UTC
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.