Closed general

Offload asks from the fusion bridge Rust port: close_window, owner/pid/hung on list_windows, wait_for_window, inline shotId, job-breakaway launch, profile-pinned open_url, rect-fraction click

John Lauer · 2mo ago ·closed by John Lauer

Context: the fusion bridge is being ported to a Rust core (Windows crate ours, a Mac crate Kyle can adopt) and the rule for the port is that every desktop touch goes through ab. An audit of the bridge found no local UIA (all of it is desktop_ui_tree / desktop_ui_click / desktop_ui_set / desktop_find_control - 23 distinct ab verbs across 82 call sites) but about 35 raw Win32 calls via ctypes. Most map to verbs that already exist (list_windows, find_window, get_foreground, bring_to_front, set_window_state, screenshot_window, press_key, type, user_idle_ms) and will be replaced. The rest need these, filed together so the offload can finish:

  1. desktop_close_window {hwnd, forceAfterMs?} - graceful WM_CLOSE with optional force. The bridge posts WM_CLOSE itself today (10 sites).
  2. desktop_list_windows rows: add owner (GW_OWNER hwnd), pid, image, minimized, maximized, enabled, hung. owner is what makes Fusion's seat / sign-in modal detector deterministic (an owned, landscape, short popup); hung distinguishes a wedged Fusion from a busy one. We currently re-enumerate with EnumWindows + GetWindow just to get owner.
  3. desktop_wait_for_window {titleContains | className | pid, state: "present" | "absent", timeoutMs} - event-driven (WinEvent hook) and returns the matching row. Replaces four polling loops in the bridge: dialog appeared, dialog closed (the window list lags a beat, which produced a false 'still open' today), popup menu open, Fusion main window up.
  4. Screenshot verbs: return coordMap.shotId inline on the direct-API response. It lives only in the screenshot's sidecar file today, which a bridge cannot read, so the zero-math desktop_click {space:"image", shotId} path was unreachable from inside the bridge (measured: the CEF-dialog click silently clicked nothing until we fell back to rect fractions).
  5. launch_process {breakawayFromJob: true} (and explicit detached) so the Fusion launch itself can go through ab instead of a local CreateProcess with CREATE_BREAKAWAY_FROM_JOB.
  6. desktop_open_url {profileDirectory} or accept an nbrowser profile key, so a sign-in URL can be pinned to the browser profile that owns the Autodesk session. Today that forces a local Popen of chrome with --profile-directory.
  7. Small: desktop_click {hwnd, fx, fy} addressing a point as a fraction of the window's own rect, for CEF dialogs that expose nothing to UIA (Fusion's Update / Create New Version / Up to Date boxes are answered by rect fraction today).

Each of these removes a class of hand-rolled Win32 from a bridge; 2, 3 and 4 also matter to any other bridge that drives a CEF- or Qt-heavy app.

1 Reply

John Lauer · 2mo ago

All seven items are delivered (shipped across 2.1.12-2.1.15, all on insiders now; verified live on AdomLapper):

  1. desktop_close_window {hwnd|titleContains, forceAfterMs?} — graceful WM_CLOSE, window-gated force, measured closed/forced + resolvedBy. Verified: notepad closed gracefully, forced:false.
  2. desktop_list_windows rows carry owner (GW_OWNER), pid, image, minimized, maximized, enabled, hung (IsHungAppWindow) — all non-messaging reads, truthful during a freeze.
  3. desktop_wait_for_window: state:"absent" + pid + className selectors + timeoutMs, 250ms poll (poll-based rather than a WinEvent hook for now — same contract, and it correctly reported another Notepad still present in my own test).
  4. Inline coordMap.shotId: verified ALREADY PRESENT on the direct-API response (top-level shotId + coordMap.shotId, tested with a raw POST on 2.1.11) — please retest on 2.1.12+ and reopen with the exact verb/branch if you still see it missing.
  5. launch_process {breakawayFromJob:true, detached:true} — CREATE_BREAKAWAY_FROM_JOB / DETACHED_PROCESS. Verified.
  6. desktop_open_url accepts profileDirectory (alias of the existing profile; chrome/edge/brave --profile-directory, firefox -P).
  7. Mouse verbs accept {hwnd|titleContains, fx, fy} — a point as a fraction of the window's OWN rect, resolved at click time. Verified landing mid-rect.

Also relevant to the port: runtimes {ensure:"python"} (#134) and the reply-shapes table in the SDK callback skill (#121, wiki pkg 2.1.15). Closing; reopen if item 4 still reproduces.

John Lauer closed this · 2mo ago

Log in to reply.