Skip to content
2 changes: 1 addition & 1 deletion source/IAccessibleHandler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def winEventToNVDAEvent( # noqa: C901
)
return None
# We do not support MSAA object proxied from native UIA
if UIAHandler.handler and UIAHandler.handler.isUIAWindow(window):
if UIAHandler.handler and UIAHandler.handler.isUIAWindow(window, isDebug=isMSAADebugLoggingEnabled()):
if isMSAADebugLoggingEnabled():
log.debug(
f"Native UIA window. Dropping winEvent {getWinEventLogInfo(window, objectID, childID, eventID)}"
Expand Down
15 changes: 15 additions & 0 deletions source/NVDAObjects/UIA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,11 @@ def kwargsFromSuper(cls, kwargs, relation=None, ignoreNonNativeElementsWithFocus
windowHandle=kwargs.get('windowHandle')
if isinstance(relation,tuple):
UIAElement=UIAHandler.handler.clientObject.ElementFromPointBuildCache(POINT(relation[0],relation[1]),UIAHandler.handler.baseCacheRequest)
if UIAHandler._isDebug():
log.debug(
f"kwargsFromSuper: given coordinates {relation}, "
f"fetched element {UIAHandler.handler.getUIAElementDebugString(UIAElement)}"
)
# Ignore this object if it is non native.
if not UIAHandler.handler.isNativeUIAElement(UIAElement):
if UIAHandler._isDebug():
Expand All @@ -1252,6 +1257,11 @@ def kwargsFromSuper(cls, kwargs, relation=None, ignoreNonNativeElementsWithFocus
except COMError:
log.debugWarning("getFocusedElement failed", exc_info=True)
return False
if UIAHandler._isDebug():
log.debug(
f"kwargsFromSuper: fetched focused element "
f"{UIAHandler.handler.getUIAElementDebugString(UIAElement)}"
)
# Ignore this object if it is non native.
if ignoreNonNativeElementsWithFocus and not UIAHandler.handler.isNativeUIAElement(UIAElement):
if UIAHandler._isDebug():
Expand Down Expand Up @@ -1292,6 +1302,11 @@ def __init__(self,windowHandle=None,UIAElement=None,initialUIACachedPropertyIDs=
UIACachedWindowHandle=UIAElement.cachedNativeWindowHandle
self.UIAIsWindowElement=bool(UIACachedWindowHandle)
if not windowHandle:
if UIAHandler._isDebug():
log.debug(
f"No windowHandle for UIA NvDAObject. "

@seanbudd seanbudd Oct 17, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix capitalization of NVDA

Suggested change
f"No windowHandle for UIA NvDAObject. "
"No windowHandle for UIA NVDAObject. "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still an issue, same with the unnecessary f-strings.
However, as the remaining changes are trivial, I am approving in the mean-time

f"Searching UIA element ancestry for nearest windowHandle"
)
windowHandle=UIAHandler.handler.getNearestWindowHandle(UIAElement)
if not windowHandle:
raise InvalidNVDAObject("no windowHandle")
Expand Down
Loading