fix(cua-driver): honor disabled UIA ancestors - #3263
Conversation
injaneity
left a comment
There was a problem hiding this comment.
the descendants are correctly effectively disabled, meaning that they have no index and are not stored in the action cache - but walk_cached_bounded creates a com reference that isn't dropped and doesn't belong to the cache
please enforce the invariant that element_ptr != 0 if and only if element_index.is_some(). retain a com reference only for actionable nodes, and use element_ptr: 0 for observation-only nodes. this also lets the walker construct uianode once instead of maintaining duplicated actionable and non-actionable literals.
another minor issue worth addressing: _observation_only walks deliberately skip the cache update, which might leave hanging references as previously mentioned
|
Thanks, fixed |
There was a problem hiding this comment.
thanks for fixing the disabled-ancestor behavior. one ownership issue still blocks this: the walker retains com references, but cleanup only happens on the successful observation-only path. for example, if screenshot processing fails after the tree walk, the function returns before the cleanup call, so every actionable reference from that walk leaks. please make the walk result release its references automatically, with an explicit ownership transfer when the cache adopts them. this also removes the need for manual cleanup at each caller.
e010659 to
f1877a2
Compare
f1877a2 to
06ab58c
Compare
|
Done @injaneity |
Enabled UIA children of a disabled parent are not actionable (eg a nominally enabled checkbox inside a disabled container cannot be actually clicked), yet Cua reports them as such on Windows. This PR allows the information to propagate from parent to children.
Validation: cargo test -p platform-windows uia::tests --locked; cargo check -p platform-windows --locked; cargo fmt --all -- --check; git diff --check. Known gap: native behavior still depends on each provider reporting the disabled ancestor accurately.