Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

Gate smokes: a locked session no longer reads as denied Accessibility

Gauthier Piarrettefa5c5369a184
diff --git a/Scripts/launch-window-smoke.sh b/Scripts/launch-window-smoke.sh
index d1f7446..5162776 100755
--- a/Scripts/launch-window-smoke.sh
+++ b/Scripts/launch-window-smoke.sh
@@ -27,6 +27,16 @@ echo "after launch: $(wins)"
# Accessibility is denied to this shell, and the smoke then fails as "no main window" with each
# line blank (2026-09-24). CG still sees the window, so tell the two apart before going on.
if [ -z "$(wins)" ] && [ "$("$ROOT/Scripts/winlist" 2>/dev/null | grep "pid=$(pid)" | grep -c on=true)" -ge 1 ]; then
+ # With the session locked or the display asleep, System Events reports no windows for any app
+ # while CG still lists them, and every keystroke below would go nowhere (2026-09-28: a gate run
+ # on the locked Mac). Denied Accessibility is a different answer, an outright refusal (-25211).
+ # The main window is on screen, which is the fact the relaunch assertion is about; the
+ # Settings-restoration scenario itself cannot be driven without a session, and the record says so.
+ ax=$(osascript -e 'tell application "System Events" to get name of first process whose frontmost is true' 2>&1)
+ if ! echo "$ax" | grep -qE "25211|assistive access"; then
+ pkill -f "$BIN" 2>/dev/null; rm -rf "$H"; record true "session locked or display asleep, main window on screen per CG, restoration scenario not driven"
+ echo "LAUNCH WINDOW SMOKE PASSED with a caveat: session locked or display asleep (System Events answers '$ax' but lists no windows), the main window is on screen per CG, the Settings-restoration scenario was not driven"; exit 0
+ fi
pkill -f "$BIN" 2>/dev/null; rm -rf "$H"; record false "accessibility denied"
echo "LAUNCH WINDOW SMOKE FAILED: the window is on screen but System Events cannot see it: Accessibility is denied to this shell (System Settings, Privacy & Security, Accessibility)"; exit 1
fi
diff --git a/Scripts/upgrade-smoke.sh b/Scripts/upgrade-smoke.sh
index 6d8b4ef..ded61be 100755
--- a/Scripts/upgrade-smoke.sh
+++ b/Scripts/upgrade-smoke.sh
@@ -106,9 +106,19 @@ if [ "$SCREEN" = 1 ]; then
# app make its window within a second yet counted none for 30 s, and the log had nothing).
echo " CG windows for pid $pid:"; "$ROOT/Scripts/winlist" 2>/dev/null | grep "pid=$pid" | sed 's/^/ /' || true
echo " System Events: $(osascript -e "tell application \"System Events\" to name of every process whose unix id is $pid" 2>&1 | head -c 200)"
- kill "$pid" 2>/dev/null || true
- [ "$cg" -ge 1 ] && fail "the window is on screen but System Events cannot see it: Accessibility is denied to this shell (System Settings, Privacy & Security, Accessibility)"
- fail "no window after 30 s"
+ # With the session locked or the display asleep, System Events reports no windows for any
+ # app while CG still lists them (2026-09-28: a gate run on the locked Mac failed here with
+ # Accessibility granted). Denied Accessibility is a different answer: System Events then
+ # refuses outright (-25211). The window being on screen is what this check wants, so when
+ # System Events still answers but lists nothing, CG's word counts.
+ ax=$(osascript -e 'tell application "System Events" to get name of first process whose frontmost is true' 2>&1)
+ if [ "$cg" -ge 1 ] && ! echo "$ax" | grep -qE "25211|assistive access"; then
+ echo " session locked or display asleep (System Events answers '$ax' but lists no windows): the window is on screen per CG, which counts"
+ else
+ kill "$pid" 2>/dev/null || true
+ [ "$cg" -ge 1 ] && fail "the window is on screen but System Events cannot see it: Accessibility is denied to this shell (System Settings, Privacy & Security, Accessibility)"
+ fail "no window after 30 s"
+ fi
fi
sleep 4
screencapture -x "$ROOT/private/upgrade-smoke/library.png" 2>/dev/null || true