Skip to content

UIA/SearchField: catch COMError when attempting to look for search fields#10492

Merged
michaelDCurran merged 3 commits into
nvaccess:masterfrom
josephsl:i10422searchFieldCOMError
Nov 18, 2019
Merged

UIA/SearchField: catch COMError when attempting to look for search fields#10492
michaelDCurran merged 3 commits into
nvaccess:masterfrom
josephsl:i10422searchFieldCOMError

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #10422

Summary of the issue:

In Windows 10, error tone is heard when navigating through pages in Settings, as well as when opening emoji panel.

Description of how this pull request fixes the issue:

Catch COMError thrown when attempting to add overlay class for search fields.

Testing performed:

Tested via Windows 10 App Essentials add-on and on source code version to make sure error tone is no longer heard.

Known issues with pull request:

None

Change log entry:

None

Additional context:

Although #10397 will catch this and resolve this at the UIA handler thread level, it is sometimes useful to figure out the root cause of issues, hence this pull request.

…elds. Re nvaccess#10422

Error thrown by Comtypes: COMError thrown when attempting to look for search fields. Therefore wrap this inside a try/except block. This resolves error tones heard when one navigates through Windows 10 Settings categories and subpages.
@josephsl josephsl requested a review from LeonarddeR November 14, 2019 16:44
Comment thread source/NVDAObjects/UIA/__init__.py Outdated
if self.UIAElement.cachedAutomationID in ("SearchTextBox", "TextBox"):
clsList.append(SearchField)
except COMError:
pass

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should still be logged.

@josephsl

josephsl commented Nov 14, 2019 via email

Copy link
Copy Markdown
Contributor Author

…s#10422.

Recommended by Leonard de Ruijter: record a log when COMError is thrown when locating search field objects.
@AppVeyorBot

Copy link
Copy Markdown

PR introduces Flake8 errors 😲

See test results for Failed build of commit 4e2c69f873

@michaelDCurran michaelDCurran merged commit d13635d into nvaccess:master Nov 18, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Nov 18, 2019
@josephsl josephsl deleted the i10422searchFieldCOMError branch August 10, 2020 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA generates error tones when opening categories and subcategories in Windows Settings

5 participants