startup: check the overlay window choice between two guests #1537
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1537
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1537/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Asimmimx on GitHub · 2026-11-24 13:45 UTC · original
Asimmimx:tests/overlay-window-check→main· +15 −2 · 2 files · 1 commits · merged 2026-11-24 16:11 UTCChange
Refs #1149. This extends
startup_overlay_window, the check forsrc/startup_stubs/overlay_window.h.overlay_window()picks the guest window that the fallback overlay (draw_overlay()ind3d12_xs_device.cpp) draws into. It enumerates top-level windows in z-order and stops at the first visible, unowned window of this process that is not the presenter.The existing check creates only one guest window. So a mutant that keeps enumerating instead of stopping at the first match (
return FALSEchanged toreturn TRUE), and therefore picks the lowest guest, left it passing.The new steps create a second guest window and use
SetWindowPos(HWND_TOP)to make the z-order explicit. They raise the first guest and expect it to be chosen (exit 6 otherwise), then raise the second and expect that one (exit 7 otherwise). The second guest is destroyed before the existing teardown.The change touches only
tests/startup_overlay_window.cppand two sentences in the "Output window and fallback diagnostics" section ofdocs/startup-runtime.md. There is no new CTest, and nothing changes insrc/.Verification
Commit
309cfede(main) plus this change,devpreset (Debug), Windows 11 Pro build 26300.9974, MSVC 19.51.36260, Windows SDK 10.0.26100.0.tests/docs_links_check.py,tests/bidi_controls_check.pyandgit diff --checkpassed.Mutation probe
I applied each mutation to the header alone, rebuilt, ran the test, then reverted. None of this is committed.
!IsWindowVisibleGW_OWNERcheck== 0→!= 0return FALSE→return TRUE(lowest guest wins)GW_OWNER→GW_CHILD!GetClassNameWfailure check* The same-process mutant is killed only because the desktop has visible, unowned windows of other processes. In a session without any, it would survive. Pinning it would need a helper child process that owns a window, which I left out of this change.
Checklist
AI-assisted (Claude Code).