Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 1.6 KB

File metadata and controls

44 lines (36 loc) · 1.6 KB

Result Log: 2026-03-10 16:27:26 CST

Goal

  • Diagnose and fix the reproduced Chrome-to-Notepad switch failure.

Investigation

Controlled live comparison

  • From Chrome foreground:
    • App.switch("Calculator") passed
    • App.switch("Notepad") failed
  • That narrowed the issue from a generic browser-to-desktop switch failure to a more specific focus-path defect.

Focus diagnosis probe

  • Added research/experiments/switch_focus_diagnose.py
  • Sequential runs showed:
    • with Chrome foreground and Notepad target, the foreground remained Chrome for the full observation window
    • the Win32 path completed without exception, so the old code never entered the fallback focus path

Root cause

  • bring_window_to_top() only used _focus_window_fallback() on exceptions.
  • It did not fall back when the Win32 path returned cleanly but still failed to move the actual foreground.

Patch

  • bring_window_to_top() now calls _focus_window_fallback() whenever GetForegroundWindow() still does not equal the target after the Win32 path completes.

Verification

Local

  • tests/test_app_service.py
    • pass
  • full suite
    • 183 passed in 5.58s

Live

  • reloaded the hot worker with DevServer(mode="reload")
  • reran the exact Chrome-to-Notepad path
  • App.switch("Notepad")
    • pass
  • follow-up Snapshot
    • pass
    • foreground window was *wmcp-type-probe-1773117083.txt - Notepad

Methodology Takeaway

  • A first attempt to compare Notepad and Calculator probes in parallel was invalid because both manipulated the same shared desktop state.
  • UI-state-changing experiments must be run sequentially.