Skip to content

Commit

Permalink
IAccessibleHandler.processDestroyWinEvent: make focus correction code…
Browse files Browse the repository at this point in the history
… specific to MSAA candidate lists as this code can seem to cause a freeze in other places such as Internet Explorer quitting. Note that the focused candidate item's parent can be the composition string, so generic focus correction is not enough. Fixes #2695
  • Loading branch information
michaelDCurran committed Oct 3, 2012
1 parent c428399 commit ea4beff
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions source/IAccessibleHandler.py
Expand Up @@ -744,12 +744,14 @@ def processDestroyWinEvent(window,objectID,childID):
del liveNVDAObjectTable[(window,objectID,childID)]
except KeyError:
pass
#Specific support for input method MSAA candidate lists.
#When their window is destroyed we must correct focus to its parent - which could be a composition string
# so can't use generic focus correction. (#2695)
focus=api.getFocusObject()
if objectID==0 and childID==0 and not eventHandler.isPendingEvents("gainFocus"):
obj=focus
while isinstance(obj,NVDAObjects.window.Window) and obj.windowHandle==window:
obj=obj.parent
if obj and obj is not focus:
from NVDAObjects.IAccessible.mscandui import BaseCandidateItem
if objectID==0 and childID==0 and isinstance(focus,BaseCandidateItem) and window==focus.windowHandle and not eventHandler.isPendingEvents("gainFocus"):
obj=focus.parent
if obj:
eventHandler.queueEvent("gainFocus",obj)

def processMenuStartWinEvent(eventID, window, objectID, childID, validFocus):
Expand Down

0 comments on commit ea4beff

Please sign in to comment.