#16

Fix timing races in the Xwayland popup focus check

OpenIIRoanwants to merge intofrom

The arm64 popup check could report that the popup stole focus after the managed control window closed. Its fixed 250 ms sleep and XSetInputFocus changed X11 focus before Satellite had restored its focused toplevel, so Satellite could create the popup as a new toplevel. Wait for the real focus handoff instead.

Also wait for Satellite to own WM_S0 before creating clients, keep the initial parent map request active until it receives focus, and include the failing setup stage in timeout errors. Repeated local runs exposed an initial map request staying queued during Satellite startup.

Run ten consecutive isolated sessions against each native amd64/arm64 image in CI, failing on the first unsuccessful session. Use a container init process to reap children between sessions. The managed-window control, popup-map check, and strict popup focus assertion remain active.

Validation:

  • Six deterministic regression tests cover delayed/missing startup, a queued initial map, delayed/missing focus restoration, and actual popup focus stealing.
  • Deliberately pausing the nested compositor for 1.5 seconds before closing the control reproduces the original expected 0x400001, got 0x400003 failure; the fixed checker passes three consecutive delayed runs with the same packages.
  • All 90 Python maintenance tests pass in the disposable Fedora image, including the six new regression tests. Twenty consecutive real x86_64 popup sessions pass.
  • Both complete CI runs passed on unchanged commit 3b428bf: first attempt and full rerun. Logs confirm 10/10 popup checks per architecture in each attempt: 20/20 arm64 and 20/20 amd64, with no observed flake.
  • Niri, Satellite, XWayland, Weston, Weston libraries, and Mesa package versions match across both CI attempts and the original flaky arm64 failure.
  • Actionlint, ShellCheck for the harness, and the eight greeter authorization tests pass.

Activity

1