You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
New in Dapplo.Windows.Automation: UiAutomationAreas.FindAreasAsync(windowHandle or IInteropWindow, maxDepth = 3, minimumSize = 0, timeout, cancellationToken) reads the UI Automation element tree (control view) of a window as immutable UiAutomationAreas (Bounds, ControlType, Name, Children) on a background (MTA) thread. It reads level by level (FindAllBuildCache with TreeScope_Children, only the children which aren't offscreen), so maxDepth limits the work; maxDepth counts the levels of the result after merging, and the token is checked before every request. For snapping a region selection to the parts of windows without child windows (web pages, Electron, WPF and UWP apps, ribbons): offscreen and empty elements are left out, elements below minimumSize with their children, rectangles are clipped to their parent, and an element with its parent's rectangle is replaced by its children. When an area whose children were read has nothing visible inside and covers a quarter of the window (Chromium builds its accessibility tree on the first request, the first answer has only the frame), the tree is read once more after half a second. The UI Automation timeouts are set to timeout (default 2 seconds). Measured with Edge: the content of a page starts at maxDepth: 4.
UiAutomationArea.GetAreasAt(point): the areas containing a point, deepest first, the top-most sibling wins on overlap; pure geometry on the snapshot.
Fixed
ToForegroundAsync returned early when the window was already the foreground window, before restoring it: a minimized window which is the foreground window stayed minimized. A minimized window is now restored first.