Changeset 2324

Show
Ignore:
Timestamp:
08/04/08 00:12:52 (4 months ago)
Author:
mdcurran
Message:

Added a new module called CoCallCancellationHandler?. This is code that can start and stop COM call cancellations. For instance if there is a COM call you know is possibly going to block for ever, make sure that CoCallCancellationHandler? has been started, and then if the call takes too long it will automatically be killed off. Once you are finished with the call, call CoCallCancellationHandler?.stop. This is managed by turning on call cancellation in OLE, then registering a generator in NVDA's core that updates an event as it executes on about every second cycle, and then creating a monitor thread which watches this cycle event and if it ever stops for more than a particular amount of time, it cancels any current COM calls. So far NVDA only uses CoCallCancellationHandler? for threee specific situations: to fix a freeze in Lotus Symphony when moving from the document to the menu bar, in Windows XP Add/Remove programs, when launching an uninstaller, and in Spybot Search and Destroy, where NVDA would freeze when it opens. All three of these freezes are fixed by this new code, though more testing must be done before we could consider using CoCallCancellationHandler? in a much more general way.

Location:
trunk/source
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/source/eventHandler.py

    r2212 r2324  
     1import CoCallCancellationHandler 
    12import queueHandler 
    23import api 
     
    8889                        continue 
    8990                executeEvent("focusEntered",parent) 
     91        if len(globalVars.focusAncestors)>1 and (obj.windowClassName=="SALTMPSUBFRAME" or  
     92(globalVars.focusAncestors[1].windowClassName=="TformMain" and  
     93globalVars.focusAncestors[1].name=="SpyBot - Search & Destroy") or  
     94globalVars.focusAncestors[1].windowClassName=="NativeHWNDHost"):  
     95                if not CoCallCancellationHandler.isRunning:  
     96                        CoCallCancellationHandler.start()  
     97        elif CoCallCancellationHandler.isRunning: 
     98                import wx 
     99                wx.CallAfter(CoCallCancellationHandler.stop) 
    90100 
    91101def doPreForeground(obj):