Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions windows/src/org/fruit/alayer/windows/StateFetcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down