diff --git a/windows/src/org/fruit/alayer/windows/StateFetcher.java b/windows/src/org/fruit/alayer/windows/StateFetcher.java index 759159565..c2ef52c5e 100644 --- a/windows/src/org/fruit/alayer/windows/StateFetcher.java +++ b/windows/src/org/fruit/alayer/windows/StateFetcher.java @@ -327,7 +327,7 @@ private UIAElement uiaDescend(long hwnd, long uiaCachePointer, UIAElement parent long uiaWindowPointer = Windows.IUIAutomationElement_GetPattern(uiaCachePointer, Windows.UIA_WindowPatternId, true); if(uiaWindowPointer != 0){ uiaElement.wndInteractionState = Windows.IUIAutomationWindowPattern_get_WindowInteractionState(uiaWindowPointer, true); - uiaElement.blocked = (uiaElement.wndInteractionState != Windows.WindowInteractionState_ReadyForUserInteraction); + uiaElement.blocked = isElementBlocked(uiaElement); uiaElement.isTopmostWnd = Windows.IUIAutomationWindowPattern_get_IsTopmost(uiaWindowPointer, true); uiaElement.isModal = Windows.IUIAutomationWindowPattern_get_IsModal(uiaWindowPointer, true); @@ -508,7 +508,18 @@ private UIAElement uiaDescend(long hwnd, long uiaCachePointer, UIAElement parent return modalElement; } - + + private boolean isElementBlocked(UIAElement uiaElement) { + // Qt applications are always started in the running state. + // Without this dedicated check TESTAR can't find any actions for the Qt application. + if (Objects.equals(uiaElement.frameworkId, "Qt")) { + return !(uiaElement.wndInteractionState == Windows.WindowInteractionState_ReadyForUserInteraction || + uiaElement.wndInteractionState == Windows.WindowInteractionState_Running); + } else { + return (uiaElement.wndInteractionState != Windows.WindowInteractionState_ReadyForUserInteraction); + } + } + // (through AccessBridge) private UIAElement abDescend(long hwnd, UIAElement parent, long vmid, long ac){ UIAElement modalElement = null;