Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prevent freezes on every focus change if Firefox stops responding.
Previously, if Firefox (or Chrome or any other app based on these) stopped responding, NVDA would often freeze every time the focused changed, even if the browser was in the background.
This occurred because NVDA queried the document on every focus change to see if it was alive, but that query blocked in the case of an unresponsive process.

Now, we don't query if the process is in the background.
We just assume the document is alive in this case.
The chances of a document dying while the browser is in the backgroud are low anyway.
However, if this did occur, the buffer will still be killed once the browser comes to the foreground or gets exited.
  • Loading branch information
jcsteh committed Dec 4, 2017
commit 2859d5ff24060c2f33e0ee4a18efc893d998de99
7 changes: 7 additions & 0 deletions source/virtualBuffers/gecko_ia2.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ def _get_isAlive(self):
return False
if not winUser.isWindow(root.windowHandle):
return False
if not root.isInForeground:
# #7818: Subsequent checks make COM calls.
# The chances of a buffer dying while the window is in the background are
# low, so don't make COM calls in this case; just treat it as alive.
# This prevents freezes on every focus change if the browser process
# stops responding; e.g. it froze, crashed or is being debugged.
return True
try:
isDefunct=bool(root.IAccessibleObject.states&IAccessibleHandler.IA2_STATE_DEFUNCT)
except COMError:
Expand Down