nvda
e86d0e07 - UI Automation in Windows Console: Cache isImprovedTextRangeAvailable and infrastructure for UIA by default (#12453)

Commit
5 years ago
UI Automation in Windows Console: Cache isImprovedTextRangeAvailable and infrastructure for UIA by default (#12453) In UIA consoles: If UIA support is disabled but UIA console somehow starts, the custom overlay class is not applied. badUIWindowClassNames and goodUIWindowClassNames are mutable, which is inconsistent with other UIA implementations. isImprovedTextRangeAvailable is queried many times, resulting in excessive cross-process calls. In newer consoles, caret movement is not delayed, so the timeout is excessively long leading to performance problems in some cases. Description of how this pull request fixes the issue: Removes the setting check when applying the overlay class (this shouldn't have been there, as the object is already UIA at the step of applying an overlay class). Removes _UIAHandler._isBadWindowClassName (added for UIA console) makes badUIWindowClassNames and goodUIWindowClassNames immutable, as tuples Adds UIAUtils._isImprovedConhostTextRangeAvailable which checks the number of visible ranges in a console at a given hwnd. This function is decorated with functools.lru_cache. Adds UIAUtils._shouldUseUIAConsole which currently just checks the config as before (when UIA console becomes default, a call to _isImprovedConhostTextRangeAvailable will be added to this function to handle the default/auto case). Removes the caret movement timeout multiplier override on consoles where isImprovedTextRangeAvailable.
Author
Parents
Loading