Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid freeze in Windows API Level 0 and 1 console when UIA support is enabled #14703

Merged
merged 21 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6097c5a
Avoid freeze in Windows API Level 0 console when UIA support is enabled
ABuffEr Mar 7, 2023
bc553c0
Update source/speechDictHandler/__init__.py
ABuffEr Mar 7, 2023
8332fc6
Use apiLevel instead of config
ABuffEr Mar 7, 2023
7ce1543
Fix lint
ABuffEr Mar 7, 2023
06bd4d0
Update source/speechDictHandler/__init__.py
ABuffEr Mar 28, 2023
6a0e6a7
Moved IGNORE_TRAILING_WHITESPACE_LENGTH outside of the function, and …
ABuffEr Mar 28, 2023
306970b
Fix lint
ABuffEr Mar 28, 2023
b0846e4
New approach: check isinstance of ConsoleUIATextInfo
ABuffEr Mar 30, 2023
f59b8c8
Update source/speechDictHandler/__init__.py
ABuffEr Apr 3, 2023
acffc63
Update source/speechDictHandler/__init__.py
ABuffEr Apr 3, 2023
d8651d8
Fix _IGNORE_TRAILING_WHITESPACE_LENGTH into function
ABuffEr Apr 3, 2023
bf542b7
Update source/speechDictHandler/__init__.py
ABuffEr Apr 4, 2023
d6f86fd
Removed global _IGNORE_TRAILING_WHITESPACE_LENGTH
ABuffEr Apr 4, 2023
54aa703
Use api.getFocusObject instead of globalVars.focusObject
ABuffEr Apr 4, 2023
ba204f5
Update source/speechDictHandler/__init__.py
ABuffEr Apr 5, 2023
46bb1a9
Update source/speechDictHandler/__init__.py
ABuffEr Apr 5, 2023
c2bddab
Merge remote-tracking branch 'origin/master' into fixIssue14689
seanbudd Apr 5, 2023
657f601
update changes
seanbudd Apr 5, 2023
0c0d82f
Fix comment lint
ABuffEr Apr 5, 2023
702754b
Merge remote-tracking branch 'origin/master' into fixIssue14689
seanbudd Apr 5, 2023
db88735
Merge branch 'fixIssue14689' of https://github.com/ABuffEr/nvda into …
seanbudd Apr 5, 2023
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
19 changes: 18 additions & 1 deletion source/speechDictHandler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from logHandler import log
import os
import codecs
import review
import api
import config
from . import dictFormatUpgrade
from .speechDictVars import speechDictsPath

Expand Down Expand Up @@ -115,9 +115,26 @@ def sub(self, text):
del self[index]
return text


def processText(text):
if not globalVars.speechDictionaryProcessing:
return text
# #14689: older (IMPROVED and END_INCLUSIVE) UIA consoles have many blank lines,
# which slows processing to a halt
focus = api.getFocusObject()
try:
# get TextInfo implementation for object review mode
textInfo, obj = review.getObjectPosition(focus)
except AttributeError: # no makeTextInfo
textInfo = None
# late import to prevent circular dependency
# ConsoleUIATextInfo is used by IMPROVED and END_INCLUSIVE consoles
from NVDAObjects.UIA.winConsoleUIA import ConsoleUIATextInfo
if isinstance(textInfo, ConsoleUIATextInfo):
stripText = text.rstrip()
IGNORE_TRAILING_WHITESPACE_LENGTH = 100
if len(text) - len(stripText) > IGNORE_TRAILING_WHITESPACE_LENGTH:
text = stripText
for type in dictTypes:
text=dictionaries[type].sub(text)
return text
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ This only worked for Bluetooth Serial ports before. (#14524)
Instead NVDA reports that the link has no destination. (#14723)
- Several stability fixes to input/output for braille displays, resulting in less frequent errors and crashes of NVDA. (#14627)
- NVDA again recovers from many more situations such as applications that stop responding which previously caused it to freeze completely. (#14759)
- When forcing UIA support with certain terminal and consoles, a bug is fixed which caused a freeze and the log file to be spammed. (#14689)
- The destination of graphic links are now correctly reported in Chrome and Edge. (#14779)
-

Expand Down