Bug 492770

Summary: ContextMenu: MenuItem Position is wrong
Product: [Mono] UI Automation Reporter: Neville Gao <ngao>
Component: Winforms - GeneralAssignee: E-mail List <mono-a11y-bugs>
Status: NEW --- QA Contact: E-mail List <mono-a11y-qa>
Severity: Normal    
Priority: P3 - Medium CC: cachen
Version: Release 1.0   
Target Milestone: Release 1.1   
Hardware: i686   
OS: openSUSE 11.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: at-spi sample.

Description Neville Gao 2009-04-07 09:55:48 UTC
Created attachment 284435 [details]
at-spi sample.

PROBLEM STATEMENT:

The position of menu item is wrong, so mouseClick action couldn't be correctly invoked at proper widget. The attached sample codes are as follows:

#!/usr/bin/env python

import pyatspi
import time

reg = pyatspi.Registry
find = pyatspi.findDescendant
findAll = pyatspi.findAllDescendants

desktop = reg.getDesktop(0)
ipy = find(desktop, lambda x: x.name == 'ipy' and x.getRoleName() == 'application')
frame = find(ipy, lambda x: x.getRoleName() == 'frame')
label = find(frame, lambda x: x.getRoleName() == 'label')

extents = label.queryComponent().getExtents(pyatspi.DESKTOP_COORDS)
x = extents.x + (extents.width / 2)
y = extents.y + (extents.height / 2)

# open context menu strip
reg.generateMouseEvent(x, y, pyatspi.MOUSE_B3C)
time.sleep(1)

context_menu = find(ipy, lambda x: x.getRoleName() == 'window')
menu_item = find(context_menu, lambda x: x.name == 'Item 1')

extents = menu_item.queryComponent().getExtents(pyatspi.DESKTOP_COORDS)
x = extents.x + (extents.width / 2)
y = extents.y + (extents.height / 2)
print x, y


REPRO:

1. Run uia2atk/test/sample/contextmenu_menuitem.py.
2. Run attached pyatspi sample.


RESULTS:

-3221225472 -3221225472


EXPECTED RESULTS:

They should be positive integers, like 50 50.
Comment 1 Sanford Armstrong 2009-04-29 07:52:35 UTC
Updating summary and hours.  If it is possible to fix this bug, it will require patches to MWF.  However, based on initial investigation while implementing providers for MenuItem and ContextMenu, it may be a very large effort to fix correctly.  Recommend focusing on ContextMenuStrip and the rest of the *Strip* API.