[Nvda-dev] commit r2058 - trunk/source
NVDA Subversion
svn at nvda-project.org
Wed May 21 11:16:27 UTC 2008
Author: mdcurran
Date: Wed May 21 11:16:26 2008
New Revision: 2058
Log:
IAccessibleHandler.processFocusWinEvent: improve the logic for handling focus events on lists and SysListView32 window client objects. No longer force a childID greater than 0 to 0. This looses info if activeChild happens to fail. Instead, if the childID is 0 and the obj has a role of list, or, this is a sysListview32 client object, try to get the real childID with focus using IAccessible::accFocus. If we successfully get a new childID that is greater than 0, then instanciate a new IAccessible NVDAObject using this new childID. This fixes the Vista windows update control panel applet's available updates list so you can interact with the focused item again.
Modified:
trunk/source/IAccessibleHandler.py
Modified: trunk/source/IAccessibleHandler.py
==============================================================================
--- trunk/source/IAccessibleHandler.py (original)
+++ trunk/source/IAccessibleHandler.py Wed May 21 11:16:26 2008
@@ -795,19 +795,21 @@
if JABHandler.isRunning and JABHandler.isJavaWindow(window):
JABHandler.event_enterJavaWindow(window)
return True
- if childID>0 and objectID==OBJID_CLIENT and winUser.getClassName(window)=="SysListView32":
- # Don't trust child IDs from SysListView32, as it reports incorrect child IDs when items are removed.
- childID=0
#Convert the win event to an NVDA event
NVDAEvent=winEventToNVDAEvent(winUser.EVENT_OBJECT_FOCUS,window,objectID,childID,useCache=False)
if not NVDAEvent:
return False
eventName,obj=NVDAEvent
- if obj.event_childID==0 and (obj.IAccessibleRole==ROLE_SYSTEM_LIST or (obj.IAccessibleRole==ROLE_SYSTEM_MENUPOPUP and obj.windowClassName=="SysListView32")):
+ if (childID==0 and obj.IAccessibleRole==ROLE_SYSTEM_LIST) or (objectID==OBJID_CLIENT and obj.windowClassName=="SysListView32"):
# Some controls incorrectly fire focus on child ID 0, even when there is a child with focus.
- child=obj.activeChild
- if child:
- obj=child
+ try:
+ realChildID=obj.IAccessibleObject.accFocus
+ except:
+ realChildID=None
+ if isinstance(realChildID,int) and realChildID>0 and realChildID!=childID:
+ realObj=NVDAObjects.IAccessible.IAccessible(IAccessibleObject=obj.IAccessibleObject,IAccessibleChildID=realChildID,event_windowHandle=window,event_objectID=objectID,event_childID=realChildID)
+ if realObj:
+ obj=realObj
return processFocusNVDAEvent(obj,needsFocusedState=needsFocusedState)
def processFocusNVDAEvent(obj,needsFocusedState=True):
More information about the Nvda-dev
mailing list