Skip to content

Commit

Permalink
Upgrade to IUIAutomation6, and UIA objects: recognize more UIA dialog…
Browse files Browse the repository at this point in the history
…s via more class names and IsDialog property in Windows 10 Redstone 5 (#8473)

* UIA handler: add class names for various dialogs encountered on Windows 7, 8.x, 10, as well as apps. Re #8405.

Windows 10 and various apps added more dilaog class names. Rather than using a static list as part of overlay class chooser in UIA object, this list, along iwth new ones, are now available in UIA handler.
Also, added constant for UIA_IsDialogPropertyID in UIA handler, to be removed once IUIAutomation6 interface support comes to NVDA, as this property ID will be included in Redstone 5.

* NVDAObjects/UIA: detect more dilaogs using class names and IsDialog property in Windows 10 RS5. Re #8405.

Instead of looking up only three class names, look up more via:
* Additional class names found in Windows 10 and various apps.
* In RS5, IsDialog property.
This allows dialogs such as app uninstlal dialog and many others to be recognized and their contents read by NVDA.

* UIA/IsDialog: address review actions. Re #8405.

Reviewed by @LeonarddeR (Babbage): simplify dialog flag via assigning this flag from exception hyandler segment rahter than setting it to False when COM error is thrown. This then allows IsDialog flag to be set whether or not exceptoin has occured.

* Upgrade to IUIAutomation6/IUIAutomationElement9 interface (based on build 17692).

* Use IsDialog property directly from IUIAutomationElement9 interface. re #8405.

* UIA: Popup is not supported as a fallback dialog class as the className is too generic. All the other classes are clearly dialogs from the name.

* Update What's new
  • Loading branch information
josephsl authored and michaelDCurran committed Jul 19, 2018
1 parent 88c64a9 commit bff9b40
Show file tree
Hide file tree
Showing 4 changed files with 3,486 additions and 3,220 deletions.
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

0 comments on commit bff9b40

Please sign in to comment.