mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
Avoid redundant Steam restart after Proton install
This commit is contained in:
1 parent
9369dc3031
commit
d09feae76f
3 files changed
+284
-32
No files matched your search
@@ -286,28 +286,10 @@ case $mode in
|
||||
if [ ! -f "$steam_root/steamapps/appmanifest_4427310.acf" ]; then
|
||||
step "asking the client to fetch the ARM64 Proton"
|
||||
set -- "$@" steam://install/4427310
|
||||
# Ported from Bannerlator (bannerlator-session, device-proven 2026-09-22). The client decides
|
||||
# a title's compatibility tool when the title is installed and keeps that decision for the
|
||||
# rest of its run, and the tool is set up before the client comes up. So once the depot has
|
||||
# fully landed, restart the client once - its own -shutdown, then the loop below, which knows
|
||||
# the marker - and every title installed from then on runs through the tool, with the
|
||||
# refreshed tool list and defaults, and no second launch by the user. A first run only: with
|
||||
# the depot present at session start nothing here is armed.
|
||||
(
|
||||
_bl_acf="$steam_root/steamapps/appmanifest_4427310.acf"
|
||||
for _ in $(seq 1 360); do
|
||||
sleep 10
|
||||
# StateFlags 4 = fully installed; a moment more for the client to finish its bookkeeping.
|
||||
if grep -q '"StateFlags"[[:space:]]*"4"' "$_bl_acf" 2>/dev/null; then
|
||||
sleep 10
|
||||
bannerlator-steam-compat "$steam_root" >/dev/null 2>&1 || true
|
||||
step "compatibility layer installed: restarting the Steam client once"
|
||||
: > "$HOME/.bl-restart-once"
|
||||
"$steam_root/steamrtarm64/steam" -shutdown >/dev/null 2>&1 || true
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
) &
|
||||
# The app's compatibility tool directory and default mapping were registered above, before
|
||||
# Steam starts. Its launcher resolves the ARM64 Proton depot when a game launches, so the
|
||||
# client can keep running while Steam installs the requested depot; restarting it here made
|
||||
# a signed-in user log on twice and wait for compat again.
|
||||
# A client that starts signed out drops that request - on a fresh install nobody has signed
|
||||
# in yet - so the install dialog only appeared after the user restarted the client by hand.
|
||||
# With no remembered sign-in, ask again once the sign-in has happened: the client binary
|
||||
@@ -479,8 +461,7 @@ BUSCONF
|
||||
# disk has to agree with the one forced here - a disagreement is the restart loop above, and
|
||||
# it is silent apart from rc=42 in this log.
|
||||
# Checked before every start, not once: the client rewrites package/beta during its own run,
|
||||
# and a restart below (rc=42, or the one after the ARM64 Proton lands) would otherwise start it
|
||||
# again on the branch it just wrote.
|
||||
# and an updater restart (rc=42) would otherwise start it again on the branch it just wrote.
|
||||
steam_channel=${BL_STEAM_CHANNEL:-publicbeta}
|
||||
steam_beta=$steam_root/package/beta
|
||||
echo "== steam args: ${_bl_ui[*]} -clientbeta $steam_channel -no-cef-sandbox -cef-force-gpu -cef-ozone-platform=x11 -cef-use-gl=angle -cef-use-angle=vulkan $*"
|
||||
@@ -488,7 +469,6 @@ BUSCONF
|
||||
# session can never again loop in silence, which reads as a menu opening and closing by itself.
|
||||
steam_updates=0
|
||||
while :; do
|
||||
rm -f "$HOME/.bl-restart-once"
|
||||
if [ -f "$steam_beta" ] && [ "$(cat "$steam_beta" 2>/dev/null)" != "$steam_channel" ]; then
|
||||
echo "== steam: client branch on disk was '$(cat "$steam_beta" 2>/dev/null)', set to '$steam_channel' to match -clientbeta"
|
||||
echo "$steam_channel" > "$steam_beta"
|
||||
@@ -500,13 +480,6 @@ BUSCONF
|
||||
rc=$?
|
||||
echo "== steam exited rc=$rc"
|
||||
collect_steam_logs
|
||||
# The session asked for this exit (the ARM64 Proton landed): start again, without the URL
|
||||
# arguments, which were acted on. Not counted against the update cap.
|
||||
if [ -f "$HOME/.bl-restart-once" ]; then
|
||||
echo "== steam: restarting once so the new compatibility layer is in the client's lists"
|
||||
set --
|
||||
continue
|
||||
fi
|
||||
[ "$rc" -eq 42 ] || break
|
||||
steam_updates=$((steam_updates + 1))
|
||||
if [ "$steam_updates" -ge 3 ]; then
|
||||
|
||||
Reference in new issue
Block a user