Skip to content

fix(desktop): make Windows capture activation reliable - #18

Merged
Bil0000 merged 2 commits into
Bil0000:feat/window-capturefrom
SunkenInTime:fix/windows-capture-foreground
Sep 3, 2026
Merged

fix(desktop): make Windows capture activation reliable#18
Bil0000 merged 2 commits into
Bil0000:feat/window-capturefrom
SunkenInTime:fix/windows-capture-foreground

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Sep 3, 2026

Copy link
Copy Markdown

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 typecheck
  • targeted vp lint
  • targeted vp fmt --check
  • real Windows Dev shortcut capture against Paint, five runs

Created with GPT-5.6 Sol in T3 Code using the Codex harness.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L labels Sep 3, 2026
@Bil0000
Bil0000 merged commit a50f8d3 into Bil0000:feat/window-capture Sep 3, 2026
10 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants