Repository: nvaccess/nvda

Issue:
UIA: just assume UIA is available as NVDA supports Windows 7 SP1 and higher
Hi,

This issue and the next are grouped under "UIA modernization":

Currently NVDA includes a config key that specifies minimum Windows release that supports UIA, thus making NVDA use it. However, this was in the old days when Vista (no longer supported) included mixture of good and bad UIA implementations, making UIA unusable in old Windows releases. Now that NVDA supports Windows 7 SP1 and later, I propose that we remove this check and just assume that UIA is available.

Thanks.


Discussion:
I think the minimum windows version can be removed indeed, but I prefer the config.conf['UIA'['enabled'] option to stay, just because there isn't a very good reason to remove it, and there might be a reason to disable UIA in some rare situations.
Hi, agreed, and that’s the implementation strategy I have in mind. Thanks.

 

From: Leonard de Ruijter <notifications@github.com> 
Sent: Tuesday, June 19, 2018 5:25 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: just assume UIA is available as NVDA supports Windows 7 SP1 and higher (#8415)

 

I think the minimum windows version can be removed indeed, but I prefer the config.conf['UIA'['enabled'] option to stay, just because there isn't a very good reason to remove it, and there might be a reason to disable UIA in some rare situations.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/8415#issuecomment-398380153> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkHcYwNWibZPrr5GAnbJ_gaghoTTbks5t-O2DgaJpZM4UsEOK> .



Resolving patch:
diff --git a/source/UIAHandler.py b/source/UIAHandler.py
--- a/source/UIAHandler.py
+++ b/source/UIAHandler.py
@@ -1,10 +1,9 @@
 #UIAHandler.py
 #A part of NonVisual Desktop Access (NVDA)
-#Copyright (C) 2008-2016 NV Access Limited
+#Copyright (C) 2008-2018 NV Access Limited, Joseph Lee
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
 
-import winVersion
 from comtypes import COMError
 import config
 from logHandler import log
@@ -13,14 +12,13 @@
 isUIAAvailable=False
 
 if config.conf and config.conf["UIA"]["enabled"]:
-	winver=winVersion.winVersion.major+(winVersion.winVersion.minor/10.0)
-	if winver>=config.conf["UIA"]["minWindowsVersion"]:
-		try:
-			from _UIAHandler import *
-			isUIAAvailable=True
-		except ImportError:
-			log.debugWarning("Unable to import _UIAHandler",exc_info=True)
-			pass
+	# Because Windows 7 SP1 (NT 6.1) or later is supported, just assume UIA can be used unless told otherwise.
+	try:
+		from _UIAHandler import *
+		isUIAAvailable=True
+	except ImportError:
+		log.debugWarning("Unable to import _UIAHandler",exc_info=True)
+		pass
 
 def initialize():
 	global handler
diff --git a/source/_UIAHandler.py b/source/_UIAHandler.py
--- a/source/_UIAHandler.py
+++ b/source/_UIAHandler.py
@@ -26,22 +26,9 @@
 
 from comtypes.gen.UIAutomationClient import *
 
-#Some new win8 UIA constants that could be missing
-UIA_StyleIdAttributeId=40034
-UIA_AnnotationAnnotationTypeIdPropertyId=30113
-UIA_AnnotationTypesAttributeId=40031
-AnnotationType_SpellingError=60001
-UIA_AnnotationObjectsAttributeId=40032
-StyleId_Heading1=70001
-StyleId_Heading9=70009
+#Some newer UIA constants that could be missing
 ItemIndex_Property_GUID=GUID("{92A053DA-2969-4021-BF27-514CFC2E4A69}")
 ItemCount_Property_GUID=GUID("{ABBF5C45-5CCC-47b7-BB4E-87CB87BBD162}")
-UIA_FullDescriptionPropertyId=30159
-UIA_LevelPropertyId=30154
-UIA_PositionInSetPropertyId=30152
-UIA_SizeOfSetPropertyId=30153
-UIA_LocalizedLandmarkTypePropertyId=30158
-UIA_LandmarkTypePropertyId=30157
 
 HorizontalTextAlignment_Left=0
 HorizontalTextAlignment_Centered=1
diff --git a/source/config/configSpec.py b/source/config/configSpec.py
--- a/source/config/configSpec.py
+++ b/source/config/configSpec.py
@@ -181,7 +181,6 @@
 	followMouse = boolean(default=False)
 
 [UIA]
-	minWindowsVersion = float(default=6.1)
 	enabled = boolean(default=true)
 	useInMSWordWhenAvailable = boolean(default=false)
 


Test patch: