Skip to content
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 objects: recognize more UIA dialogs via more class names and IsDialog property in Windows 10 Redstone 5 #8473

Merged
merged 10 commits into from Jul 19, 2018
9 changes: 8 additions & 1 deletion source/NVDAObjects/UIA/__init__.py
Expand Up @@ -789,7 +789,14 @@ def findOverlayClasses(self,clsList):
elif UIAControlType==UIAHandler.UIA_ListItemControlTypeId:
clsList.append(ListItem)
# #5942: In Windows 10 build 14332 and later, Microsoft rewrote various dialog code including that of User Account Control.
if self.UIAIsWindowElement and UIAClassName in ("#32770","NUIDialog", "Credential Dialog Xaml Host"):
# #8405: there are more dialogs scattered throughout Windows 10 and various apps.
# Dialog detection is a bit easier on build 17682 and later thanks to IsDialog property.
try:
isDialog = self._getUIACacheablePropertyValue(UIAHandler.UIA_IsDialogPropertyId)
except COMError:
# We can fallback to a known set of dialog classes for window elements.
isDialog = (self.UIAIsWindowElement and UIAClassName in UIAHandler.UIADialogClassNames)
if isDialog:
clsList.append(Dialog)
# #6241: Try detecting all possible suggestions containers and search fields scattered throughout Windows 10.
# In Windows 10, allow Start menu search box and Edge's address omnibar to participate in announcing appearance of auto-suggestions.
Expand Down
10 changes: 10 additions & 0 deletions source/_UIAHandler.py
Expand Up @@ -63,6 +63,16 @@
"ConsoleWindowClass",
]

# #8405: used to detect UIA dialogs prior to Windows 10 RS5.
UIADialogClassNames=[
"#32770",
"NUIDialog",
"Credential Dialog Xaml Host", # UAC dialog in Anniversary Update and later
"Shell_Dialog",
"Shell_Flyout",
"Shell_SystemDialog", # Various dialogs in Windows 10 Settings app
]

NVDAUnitsToUIAUnits={
"character":TextUnit_Character,
"word":TextUnit_Word,
Expand Down