Skip to content

Host: put our windows on the interactive desktop - #16

Merged
wbkepler merged 2 commits into
mainfrom
host/attach-default-desktop
Nov 25, 2026
Merged

wbkepler merged 2 commits into
mainfrom
host/attach-default-desktop

Conversation

@wbkepler

Copy link
Copy Markdown
Owner

Puts our windows on the interactive desktop (WinSta0\Default) even when VIctory is started from another desktop, e.g. a sandbox's own.

  • New victory_gpu::desktop::attach(): once per process it opens WinSta0 (SetProcessWindowStation) and the Default desktop (handle stays open for the process's life). Then, once per thread, it calls SetThreadDesktop.
  • A thread's desktop belongs to that thread, so attach() runs on every thread that makes windows: main, the host window thread, the stand-in thread, and title threads in the CreateWindowExW/A hooks.
  • If a call fails (no access, or the thread already has windows), nothing changes and a debug line is logged.

Gate: clippy (victory-gpu, victory-hle, victory with diagnostics) clean, cargo xtask policy ok. Not live-tested yet.

🤖 Generated with Claude Code

wbkepler and others added 2 commits November 25, 2026 22:39
Started from another desktop (a sandbox's own, say), our windows landed
where nobody sees them. The process now switches to the WinSta0 window
station and each window-making thread (main, the host window thread, the
stand-in thread, title threads at CreateWindowEx) to its Default desktop
before its first window. Failures leave things as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EnumWindows, GetForegroundWindow and GetAsyncKeyState answer only for the
calling thread's desktop. Started elsewhere, the presenting thread missed
the title's stand-in and made a second window, and the input thread saw
no focus and no keys. Both threads now attach to the Default desktop too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wbkepler
wbkepler merged commit 70449c4 into main Nov 25, 2026
1 check passed
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.

1 participant