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
Changes from 4 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
10 changes: 9 additions & 1 deletion source/speechDictHandler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import os
import codecs
import api
import config
from . import dictFormatUpgrade
from .speechDictVars import speechDictsPath

Expand Down Expand Up @@ -118,6 +117,15 @@ def sub(self, text):
def processText(text):
if not globalVars.speechDictionaryProcessing:
return text
# #14689: API level < 2 UIA consoles have many blank lines, which slows processing to a halt
ABuffEr marked this conversation as resolved.
Show resolved Hide resolved
# Because from UIAHandler.constants import WinConsoleAPILevel
# cause crashes as global import, and probably slowdowns here
# use 2 instead of WinConsoleAPILevel.FORMATTED constant
focus = api.getFocusObject()
if hasattr(focus, "apiLevel") and focus.apiLevel < 2:
ABuffEr marked this conversation as resolved.
Show resolved Hide resolved
ABuffEr marked this conversation as resolved.
Show resolved Hide resolved
stripText = text.rstrip()
if len(text) - len(stripText) > 10000:
text = stripText
ABuffEr marked this conversation as resolved.
Show resolved Hide resolved
for type in dictTypes:
text=dictionaries[type].sub(text)
return text
Expand Down