Skip to content

Commit cd7869a

Browse files
authored
Merge 1c65d87 into 96d59ec
2 parents 96d59ec + 1c65d87 commit cd7869a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

source/UIAHandler/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,8 +1144,14 @@ def _isUIAWindowHelper(self, hwnd: int, isDebug=False) -> bool: # noqa: C901
11441144
# Using IAccessible for NetUIHWND controls causes focus changes not to be reported
11451145
# when the ribbon is collapsed.
11461146
# Testing shows that these controls emits proper events but they are ignored by NVDA.
1147-
isOfficeApp = appModule.productName.startswith(("Microsoft Office", "Microsoft Outlook"))
1148-
isOffice2013OrOlder = int(appModule.productVersion.split(".")[0]) < 16
1147+
# this is not necessarily an office app, or an app with version information, for example geekbench 6.
1148+
try:
1149+
isOfficeApp = appModule.productName.startswith(("Microsoft Office", "Microsoft Outlook"))
1150+
isOffice2013OrOlder = int(appModule.productVersion.split(".")[0]) < 16
1151+
except Exception:
1152+
log.debugWarning("Unable to parse productName or productVersion, version information likely unavailable", exc_info=True)
1153+
isOfficeApp = False
1154+
isOffice2013OrOlder = False
11491155
if isOfficeApp and isOffice2013OrOlder:
11501156
parentHwnd = winUser.getAncestor(hwnd, winUser.GA_PARENT)
11511157
while parentHwnd:

0 commit comments

Comments
 (0)