OSDN Git Service

Partial fix for #862 (Slow system menu in IE in XP). This fix cuts the freeze time...
authorMichael Curran <mick@kulgan.net>
Mon, 13 Sep 2010 23:26:01 +0000 (09:26 +1000)
committerMichael Curran <mick@kulgan.net>
Mon, 13 Sep 2010 23:26:01 +0000 (09:26 +1000)
source/watchdog.py

index 1cdc610..a065bfe 100644 (file)
@@ -82,10 +82,13 @@ def _shouldRecoverAfterMinTimeout():
        info=winUser.getGUIThreadInfo(0)\r
        #If hwndFocus is 0, then the OS is clearly busy and we don't want to timeout prematurely.\r
        if not info.hwndFocus: return False\r
-       if winUser.getClassName(info.hwndFocus) in safeWindowClassSet:\r
-               return False\r
        # Import late to avoid circular import.\r
        import api\r
+       #If a system menu has been activated but NVDA's focus is not yet in the menu then use min timeout\r
+       if info.flags&winUser.GUI_SYSTEMMENUMODE and info.hwndMenuOwner and api.getFocusObject().windowClassName!='#32768':\r
+               return True \r
+       if winUser.getClassName(info.hwndFocus) in safeWindowClassSet:\r
+               return False\r
        if not winUser.isDescendantWindow(info.hwndActive, api.getFocusObject().windowHandle):\r
                # The foreground window has changed.\r
                return True\r