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