UI Automation in Windows Console: Always use ConsoleUIATextInfo in UIA consoles #10052
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #10030. Related to #9614.
Summary of the issue:
NVDA incorrectly reports an empty selection when focusing Windows consoles.
Since the
TextInfo
property on consoles was prefixed with an underscore, NVDA dynamically selected the wrongTextInfo
implementation (seeNVDAObjects.UIA.UIA._getTextInfo
). This means that when a console is first focused,UIATextInfo
is selected instead ofWinConsoleUIA.TextInfo
, so our patchedisCollapsed
logic isn't used andspeech.speakPreselectedText
is called (see lines 391–393 inspeech/__init__.py
).Description of how this pull request fixes the issue:
Assign the
textInfo
class asWinConsoleUIA.TextInfo
rather thanWinConsoleUIA._TextInfo
.Testing performed:
Tested steps from the issue and confirmed that no superfluous selections are reported.
Known issues with pull request:
None.
Change log entry:
None.