Skip to content

fix(cua-driver): keep Windows cursor visible without focus theft - #2864

Merged
f-trycua merged 6 commits into
mainfrom
codex/fix-windows-cursor-z-order-2802
Aug 5, 2026
Merged

fix(cua-driver): keep Windows cursor visible without focus theft#2864
f-trycua merged 6 commits into
mainfrom
codex/fix-windows-cursor-z-order-2802

Conversation

@f-trycua

@f-trycua f-trycua commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make the un-targeted Windows cursor overlay reliably reach the front of the ordinary z-order band with a non-activating transient HWND_TOPMOSTHWND_NOTOPMOST transition
  • preserve target-bound placement exactly between the target and an independent foreground window
  • add a pure branch-selection regression plus hosted Windows coverage for move-only visibility, final non-topmost state, unchanged focus and real cursor, targeted effect isolation, and the existing no-leaked-input oracle

Fixes #2802

Verification

  • cargo fmt --all -- --check
  • git diff --check
  • cargo test -p platform-windows --lib — 41 passed
  • cargo test -p cursor-overlay --lib — 42 passed
  • cargo test -p cua-driver --test agent_cursor_windows_test — compiles on the local non-Windows host; 0 Windows-gated tests run
  • cargo check --target x86_64-pc-windows-msvc -p cua-driver --test agent_cursor_windows_test — local cross-check cannot complete because the macOS host lacks Windows SDK/MSVC C headers required by transitive native dependencies; the canonical interactive Windows lane is the authoritative compile and behavior gate

Hosted Windows certification

  • exact source: 4f1e63bbfbd7b22ac16c2d0559f6a4934e32d2ba
  • canonical native-lane dispatch: https://github.com/trycua/cua/actions/runs/30965712916
  • windows-desktop-agent-cursor-px — PASS (Pixels, Focus, ZOrder, Cursor); proves visible un-targeted overlay at the top of the ordinary band, final non-topmost state, unchanged foreground and physical pointer, then target-bound placement between the WPF target and an independent Electron foreground window with target counter effect and no foreground leak
  • windows-desktop-agent-cursor-no-input-leak — PASS (Focus, ZOrder, Cursor, NoLeakedInput)
  • the cursor test binary completed 2 passed; 0 failed
  • downloaded results.jsonl SHA-256: 7ee13e3ea9dbfbade0be1303d440a657d724a27054cad72da295d1ac5e98123c
  • downloaded summary.md SHA-256: 6d980c825c05c3a0bf3288f84d797e5f8c1e107066b1b76d43cfb9fb946c5dba

The native lane's only failing cell was the unrelated existing windows-webview2-left-click-px-background: UIA desktop enumeration exceeded its 2-second deadline and the action fell back to global_input while that cell expected accessibility. That cell passed in the two preceding exact-head native runs (30963333853 and 30964551564); the final-head change only replaces the cursor test's target fixture. All 41 other final-run matrix cells, including both cursor cells, passed or produced their expected refusal.

Standard PR checks are green, including the bounded Nix unit-test retry. The installer compatibility summary was still queued at the time this evidence was attached.

This PR remains draft for final audit; it has not been graduated or merged.

@f-trycua
f-trycua marked this pull request as ready for review August 5, 2026 01:34
@f-trycua
f-trycua merged commit 2e7a412 into main Aug 5, 2026
38 of 39 checks passed
@f-trycua
f-trycua deleted the codex/fix-windows-cursor-z-order-2802 branch August 5, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cua-driver-rs (Windows): the agent cursor is occluded by ordinary windows — an un-targeted session cursor never regains its z-slot

1 participant