Repository: nvaccess/nvda

Issue:
NVDA generates error tones when opening categories and subcategories in Windows Settings
### Steps to reproduce:
1. Update NVDA to the latest alpha snapshot build.
2. Open Windows Settings (press Windows+I).
3. Navigate to the list of categories and open a few of them and a few subcategories within them with ENTER. The "System" one is a good example for reproducing the issue.

### Actual behavior:
When opening some of the categories and subcategories, NVDA plays its error sound at least once, which probably indicates some sort of error occurring.

### Expected behavior:
No error should occur when opening categories and subcategories within Windows Settings.

### System configuration
- Operating system: Windows 10 Pro version 1903 (build 18362.449), 64-bit, in Bulgarian with all locale settings set to "Bulgarian".
- NVDA version: alpha-19012,5a0b42ea, in bulgarian.
- Processor: Intel Core i5-4670 at 3.40GHz.
- RAM Memory: 8.00GB.
- Graphics: MSI GeForce GTX-1050TI Gaming X 4G, 4096MB dedicated memory + 4065MB shared system memory, desktop resolution set to 1920x1080.
- Sound Card: Realtek ALC887 at Intel Lynx Point PCH - High Definition Audio Controller.

### Other questions
#### Does the issue still occur after restarting your PC?
Yes, it does.

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
I've tried with NVDA 2019.2.1 and the problem seams not to occur. More importantly, this was not occurring with alpha snapshots also until recently, so the fault must be in some recent changes. Maybe related to the changes made for suppressing the NVDA progress bar indications for Windows 10 volume level indicators in the Windows Settings panel (?).

[nvda-old.log](https://github.com/nvaccess/nvda/files/3771014/nvda-old.log)
I'm attaching a log created while reproducing the issue, done with add-ons disabled.


Discussion:
Hi Kostadin,

This started before the progress bar modifications.

i.e when we have enabled the debugging for comtypes.

It catches some strange comtypes errors.

 

From: Kostadin Kolev <notifications@github.com> 
Sent: Friday, October 25, 2019 11:02 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [nvaccess/nvda] NVDA generates error tones when opening categories and subcategories in Windows Settings (#10422)

 


Steps to reproduce:


1.	Update NVDA to the latest alpha snapshot build.
2.	Open Windows Settings (press Windows+I).
3.	Navigate to the list of categories and open a few of them and a few subcategories within them with ENTER. The "System" one is a good example for reproducing the issue.


Actual behavior:


When opening some of the categories and subcategories, NVDA plays its error sound at least once, which probably indicates some sort of error occurring.


Expected behavior:


No error should occur when opening categories and subcategories within Windows Settings.


System configuration


*	Operating system: Windows 10 Pro version 1903 (build 18362.449), 64-bit, in Bulgarian with all locale settings set to "Bulgarian".
*	NVDA version: alpha-19012,5a0b42ea, in bulgarian.
*	Processor: Intel Core i5-4670 at 3.40GHz.
*	RAM Memory: 8.00GB.
*	Graphics: MSI GeForce GTX-1050TI Gaming X 4G, 4096MB dedicated memory + 4065MB shared system memory, desktop resolution set to 1920x1080.
*	Sound Card: Realtek ALC887 at Intel Lynx Point PCH - High Definition Audio Controller.


Other questions


Does the issue still occur after restarting your PC?


Yes, it does.


Have you tried any other versions of NVDA? If so, please report their behaviors.


I've tried with NVDA 2019.2.1 and the problem seams not to occur. More importantly, this was not occurring with alpha snapshots also until recently, so the fault must be in some recent changes. Maybe related to the changes made for suppressing the NVDA progress bar indications for Windows 10 volume level indicators in the Windows Settings panel (?).

nvda-old.log <https://github.com/nvaccess/nvda/files/3771014/nvda-old.log> 
I'm attaching a log created while reproducing the issue, done with add-ons disabled.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/10422?email_source=notifications&email_token=ACVCDE25LEHSOCEQO34P3XTQQKRWXA5CNFSM4JE755IKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUKCGBQ> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACVCDEYK4GLBGHKANYKGWO3QQKRWXANCNFSM4JE755IA> .  <https://github.com/notifications/beacon/ACVCDE7EWQUCWJ6XK3OABXLQQKRWXA5CNFSM4JE755IKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUKCGBQ.gif> 


These errors are caused by increased error logging by comtypes, fortunately it is nothing to worry about. However, the errors indicate an error in our code that needs to be fixed, and that's covered in #10397 
Hi,

At least in alpha build 19040, it points to search box detection routine in NVDAObjects.UIA.UIA.findOverlayClasses, for which it is a bit trivial to write a solution. I'd rather wait for more errors to show up before working on it.

Thanks.

Resolving patch:
diff --git a/source/NVDAObjects/UIA/__init__.py b/source/NVDAObjects/UIA/__init__.py
--- a/source/NVDAObjects/UIA/__init__.py
+++ b/source/NVDAObjects/UIA/__init__.py
@@ -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:
+			log.debug("Failed to locate UIA search field", exc_info=True)
 		try:
 			# Nested block here in order to catch value error and variable binding error when attempting to access automation ID for invalid elements.
 			try:


Test patch: