fix(desktop): make Windows capture activation reliable - #18
Merged
Bil0000 merged 2 commits intoSep 3, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows capture reveal was both unreliable and slow because it always paid for a UI Automation scan before asking Windows to activate T3's HWND, while accessibility extraction spawned and imported a fresh helper on every capture.
This makes native HWND activation the primary reveal path. If Windows refuses it, the existing exact-window UI Automation path runs as a compatibility fallback, followed by a required native activation retry. Source accessibility acquisition still starts before T3 is revealed, but a prewarmed one-shot helper is handed to each capture and immediately replaced so crash isolation and overlapping captures remain intact.
A five-run Windows shortcut benchmark with accessibility, flash, and animation enabled measured 164.5–206.2 ms from shortcut injection to T3 owning the foreground, with a 196.8 ms median. The same path measured a 1,088.4 ms median before this change.
Tests:
vp test run apps/desktop/src/electron/ElectronWindow.test.ts apps/desktop/src/windowCapture/WindowCaptureAccessibilityProcess.test.ts apps/desktop/src/windowCapture/DesktopWindowCapture.test.ts(124 tests)vp run --filter @t3tools/desktop typecheckvp lintvp fmt --checkCreated with GPT-5.6 Sol in T3 Code using the Codex harness.