fix(session): wait for Steam readiness before launch (#2362)

* fix(session): wait for Steam readiness before launch

* fix(session): keep the launch fallback when Steam readiness or the interstitial is unavailable

* fix(session): cap the Steam readiness wait by elapsed time and bound each check

* fix(session): keep waiting for Steam readiness through focus changes and never pass a zero timeout
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-09 18:23:24 -05:00
1 parent 836340f3a2
commit 6bcd431ca6
4 files changed
+97 -14

No files matched your search

@@ -1244,7 +1244,14 @@ case $mode in
sleep 1
done
[ "${#game}" -gt 10 ] && shortcut=1
[ -n "$shortcut" ] || sleep 4
_bl_ready_end=$((SECONDS + 30))
while [ "$waited" -lt 30 ] && [ "$((_bl_ready_end - SECONDS))" -gt 0 ]; do
timeout "$((_bl_ready_end - SECONDS))" /usr/local/bin/droiddeck-agent --steam-ready >/dev/null 2>&1 && break
[ "$((_bl_ready_end - SECONDS))" -gt 1 ] || break
sleep 1
waited=$((waited + 1))
done
waited=0
echo "== steam: interface up; launching the requested game $game"
_bl_hand_off
[ -n "$shortcut" ] || return 0
@@ -1264,7 +1271,9 @@ case $mode in
elif _bl_starting; then
echo "== steam: the requested game started while waiting; not launching again"
elif [ "$(_bl_focused)" = 769 ]; then
echo "== steam: launching the requested game again $game (overview status $status)"
echo "== steam: clearing the pending launch interstitial for $game (overview status $status)"
/usr/local/bin/droiddeck-agent --steam-clear-pending-interstitial "$(((game >> 32) & 0xffffffff))" >/dev/null 2>&1 && return 0
echo "== steam: launching the requested game again $game"
_bl_hand_off
else
echo "== steam: the game took focus while waiting; not launching again"