Bugzilla – Bug 508055
MenuStrip: menu item gets "focused" state from selectChild when menu is collapsed
Last modified: 2009-07-02 03:21:31 UTC
PROBLEM STATEMENT Calling pyatspi's selectChild method on a menu item of a menu on a menu bar results in the menu item accessible receiving the "focused". The problem is that this occurs not only when the menu item's menu is drop-down--which is expected--but it also occurs when the menu item's menu is collapsed (i.e., when the menu item isn't showing). REPRO 1. Run uia2atk/test/samples/menustrip.py 2. Run the attached pyatspi script, which does the following: 1. Prints the states of the "Paste" menu item 2. calls selectChild(1) on the "Edit" menu, which selects the "Paste" menu item of the "Edit" menu 3. Prints the states of the "Paste" menu item (and the "Copy" menu item for comparison. RESULTS The "Paste" menu item has gained the "selected" state--which is expected--but it also gains the "focused" state, even though the "Edit" menu is collapsed and the "Paste" menu item isn't showing. EXPECTED RESULTS The "Paste" menu item should only receive the "selected" state. I have verified the expected behavior in Gtk (with the gtkmenubar.py sample). COMMENTS There are some commented out lines in the script that you can uncomment that clicks on the "Edit" menu first before calling the selectChild method. Doing this results in the expected behavior of both the "focused" and "selected" methods being added to the "Paste" menu item.
Created attachment 295099 [details] pyatspi script referenced in REPRO steps