startup: check the overlay window choice between two guests #1530
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1537"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Asimmimx on 2026-11-24T13:45:03Z.
Change
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).