-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
UIA/SearchField: catch COMError when attempting to look for search fields #10492
Merged
michaelDCurran
merged 3 commits into
nvaccess:master
from
josephsl:i10422searchFieldCOMError
Nov 18, 2019
Merged
UIA/SearchField: catch COMError when attempting to look for search fields #10492
michaelDCurran
merged 3 commits into
nvaccess:master
from
josephsl:i10422searchFieldCOMError
Nov 18, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
LeonarddeR
suggested changes
Nov 14, 2019
source/NVDAObjects/UIA/__init__.py
Outdated
if self.UIAElement.cachedAutomationID in ("SearchTextBox", "TextBox"): | ||
clsList.append(SearchField) | ||
except COMError: | ||
pass |
There was a problem hiding this comment.
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.
Hi, I see – changes under way. Thanks.
From: Leonard de Ruijter <notifications@github.com>
Sent: Thursday, November 14, 2019 10:22 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Author <author@noreply.github.com>
Subject: Re: [nvaccess/nvda] UIA/SearchField: catch COMError when attempting to look for search fields (#10492)
@LeonarddeR requested changes on this pull request.
_____
In source/NVDAObjects/UIA/__init__.py <#10492 (comment)> :
@@ -863,8 +863,11 @@ def findOverlayClasses(self,clsList):
if isDialog:
clsList.append(Dialog)
# #6241: Try detecting all possible suggestions containers and search fields scattered throughout Windows 10.
- if self.UIAElement.cachedAutomationID in ("SearchTextBox", "TextBox"):
- clsList.append(SearchField)
+ try:
+ if self.UIAElement.cachedAutomationID in ("SearchTextBox", "TextBox"):
+ clsList.append(SearchField)
+ except COMError:
+ pass
I think this should still be logged.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#10492?email_source=notifications&email_token=AB4AXEANZO7SQKIJPQNSRWDQTWJK7A5CNFSM4JNOOVCKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCLTYPPY#pullrequestreview-317163455> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB4AXECTMZ4LK4VAPL6A3QLQTWJK7ANCNFSM4JNOOVCA> .
|
…s#10422. Recommended by Leonard de Ruijter: record a log when COMError is thrown when locating search field objects.
PR introduces Flake8 errors 😲 See test results for Failed build of commit 4e2c69f873 |
LeonarddeR
approved these changes
Nov 18, 2019
michaelDCurran
approved these changes
Nov 18, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #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.