Merge main into Wine timezone fix

This commit is contained in:
Kurt Himebauch committed 2026-12-06 09:36:33 -05:00
commit 3f3932d575
941 files changed
+106838 -7538

No files matched your search

+97 -6
View File
@@ -29,6 +29,11 @@ echo "$(date +%H:%M:%S) $verb $EXE ($VERSION, uid $(id -u), DISPLAY ${DISPLAY:-u
# Keep Steam's game identity, DroidDeck's input/display/driver/sync settings and its game environment (the names
# ../proton lists in DROIDDECK_BIONIC_KEEP); drop the rest of the glibc guest's environment.
KEEP=" ${DROIDDECK_BIONIC_KEEP:-} "
# The built-in DirectAudio driver reads DroidDeck's AUDIO_DIRECT_* settings (the microphone switch among them) under
# the BANNER_ names droiddeck-proton gives them for Proton.
for v in $(env | sed -n 's/^\(AUDIO_DIRECT_[A-Za-z0-9_]*\)=.*/\1/p'); do
eval "export BANNER_$v=\"\$$v\""
done
for v in $(env | sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p'); do
case "$KEEP" in *" $v "*) continue ;; esac
case "$v" in
@@ -36,7 +41,7 @@ for v in $(env | sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p'); do
ANDROID_*|BOOTCLASSPATH|DEX2OATBOOTCLASSPATH|SYSTEMSERVERCLASSPATH|EXTERNAL_STORAGE|ASEC_MOUNTPOINT) ;;
FAKE_*|SDL_*|DD_WIDTH|DD_HEIGHT|DD_VK_DRIVER|WINEDLLOVERRIDES) ;;
DISPLAY|GAMESCOPE_WAYLAND_DISPLAY|FEX_*) ;;
TU_DEBUG|MESA_NO_ERROR|DXVK_CONFIG|DXVK_HUD|DROIDDECK_FORCE_SSBS) ;;
TU_DEBUG|MESA_NO_ERROR|DXVK_CONFIG|DXVK_HUD|DROIDDECK_FORCE_SSBS|DROIDDECK_NO_STEAM|BANNER_AUDIO_DIRECT_*) ;;
mesa_glthread|vblank_mode|ZINK_*|GALLIUM_HUD|GALLIUM_THREAD) ;;
DD_SYNC|DD_FSYNC_FIRST|DD_SYNC_FALLBACK|PROTON_NO_ESYNC|PROTON_NO_FSYNC|PROTON_NO_NTSYNC|WINEESYNC) ;;
PROTON_USE_D7VK) ;;
@@ -47,6 +52,13 @@ for v in $(env | sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=.*/\1/p'); do
DROIDDECK_GPU_LOAD|DROIDDECK_GPU_LOAD_DIR|DROIDDECK_VRAM_CAP|DROIDDECK_VRAM_CAP_MB|DROIDDECK_DISPLAY_DRIVER) ;;
DROIDDECK_GUEST_ROOT) ;;
VKD3D_FEATURE_LEVEL|VKD3D_SHADER_MODEL|vk_x11_strict_image_count) ;;
# droiddeck-game-env's original Xbox switches for this layer's Wine and the Xbox VKD3D-Proton build
WINE_SPECIAL_APC_INTERRUPT|WINE_MF_DISPLAY_APERTURE|WINE_PRECISE_SLEEP) ;;
VKD3D_INTEROP_PRESENT|VKD3D_PACKED_422|VKD3D_PACKED_422_SWIZZLE) ;;
# The exec handoff (../handoff.c): the app's spawn socket and list (the app starts a handed-off program from the
# glibc root's shell, so its path too), and what a worker hands the program it runs (this script, when it runs
# in one): the first Wine process's hook knows the worker's binder fds are not its own.
DD_SPAWN|DD_SPAWN_SESSION|DD_HANDOFF|DD_HANDOFF_DEBUG|DD_HANDOFF_PRESSURE|DDH_*|DDNATV_ROOT) ;;
*) unset "$v" 2>/dev/null ;;
esac
done
@@ -81,7 +93,8 @@ RTD=$APP/.wayland-rt
export VK_ICD_FILENAMES=$PACK/adapter/icd.json ADRENOTOOLS_DRIVER_PATH=$DRVDIR/ ADRENOTOOLS_HOOKS_PATH=$PACK/lib
export ADRENOTOOLS_DRIVER_NAME=$(drvlib "$DRVDIR")
export VK_ADD_IMPLICIT_LAYER_PATH=$PACK/layer ENABLE_GAMESCOPE_WSI=1 GAMESCOPE_WAYLAND_DISPLAY=${GAMESCOPE_WAYLAND_DISPLAY:-gamescope-0}
export XDG_RUNTIME_DIR=$RTD DROIDDECK_WSI_BYPASS_CHECK_MS=100 GAMESCOPE_WSI_FORCE_BYPASS=1
export XDG_RUNTIME_DIR=$RTD DROIDDECK_WSI_BYPASS_CHECK_MS=100 GAMESCOPE_WSI_FORCE_BYPASS=0
echo "WSI forced XWayland bypass disabled (GAMESCOPE_WSI_FORCE_BYPASS=$GAMESCOPE_WSI_FORCE_BYPASS)"
[ -e "$RTD/droiddeck-gamescope-limiter" ] && export GAMESCOPE_LIMITER_FILE=$RTD/droiddeck-gamescope-limiter
# Wine: DXVK/VKD3D over the builtins, X11 inside gamescope (winewayland would pick DroidDeck's compositor),
@@ -104,6 +117,9 @@ export NTSYNC_SHM=$COMPAT/ntsync-shm
# DroidDeck's Force SSBS (its glibc libssbs.so preload) is bionic Wine's own WINE_FORCE_SSBS
on "${DROIDDECK_FORCE_SSBS:-}" && export WINE_FORCE_SSBS=1
export HODLL=libwow64fex.dll WINEDEBUG=err+all,fixme-all
# The network adapter list (GetAdaptersAddresses) from the layer's getifaddrs code: its default if_nameindex code never
# answered here, and the Paradox Launcher (Europa Universalis IV) waited on it forever.
export WINE_NEW_NDIS=${WINE_NEW_NDIS:-1}
export XENVIRONMENT=$TOOL/bionic/Xdefaults
# The adapter's Wayland swapchain gets its buffers back from gamescope later than DroidDeck-Proton's Turnip does;
# with gamescope's default three images the game waits for one about a fifth of the time at high frame rates.
@@ -122,6 +138,13 @@ echo "sync ntsync=$WINENTSYNC esync=$WINEESYNC ssbs=${WINE_FORCE_SSBS:-0} tu_deb
export WINESTEAMCLIENTPATH64=$ROOTFS/root/.local/share/Steam/androidarm64/libsteamclient.so
# The layer sends a game's steamclient(64).dll to lsteamclient (and so to DroidDeck's Steam through the library
# above) only with WINE_LSTEAMCLIENT set; without it Valve's Windows steamclient runs alone and SteamAPI_Init fails.
# A game set to start without Steam has no Steam client behind lsteamclient, and a steamclient64.dll it brings itself
# (a Steam emulator such as gbe_fork's ColdClient loader) would be replaced by it, so the game quit after its splash
# screen. Such a game keeps its own; a WINE_LSTEAMCLIENT the player set wins.
if [ -z "${WINE_LSTEAMCLIENT:-}" ] && on "${DROIDDECK_NO_STEAM:-}"; then
echo "lsteamclient off: started without Steam"
export WINE_LSTEAMCLIENT=0
fi
export WINE_LSTEAMCLIENT=${WINE_LSTEAMCLIENT:-1}
# Steam Input data (Valve's Steam Deck layouts with game actions) lives in DroidDeck's /dev/shm; libsteamshm.so
# points the Android library's shared memory there (it keeps its own in-process otherwise) and gives it the
@@ -250,7 +273,7 @@ prepare_prefix() {
prefix_busy() { # a process of this prefix is running
for p in /proc/[0-9]*; do
[ "${p#/proc/}" = "$$" ] && continue
tr '\0' '\n' < "$p/environ" 2>/dev/null | grep -qx "WINEPREFIX=$COMPAT/pfx" && return 0
tr '\0' '\n' 2>/dev/null < "$p/environ" | grep -qx "WINEPREFIX=$COMPAT/pfx" && return 0
done
return 1
}
@@ -265,7 +288,7 @@ programs_left() { # a program of this prefix is still running, apart from Wine's
""|wineserver|services.exe|winedevice.exe|plugplay.exe|explorer.exe|svchost.exe|rpcss.exe|conhost.exe|start.exe|\
winemenubuilder|wineboot.exe|tabtip.exe) continue ;;
esac
tr '\0' '\n' < "$p/environ" 2>/dev/null | grep -qx "WINEPREFIX=$COMPAT/pfx" && return 0
tr '\0' '\n' 2>/dev/null < "$p/environ" | grep -qx "WINEPREFIX=$COMPAT/pfx" && return 0
done
return 1
}
@@ -274,7 +297,7 @@ stop_wine() { # wineserver -k, then whatever of this prefix is left (e.g. a game
wineserver_ -k 2>/dev/null
sleep 1
for p in /proc/[0-9]*; do
tr '\0' '\n' < "$p/environ" 2>/dev/null | grep -qx "WINEPREFIX=$COMPAT/pfx" || continue
tr '\0' '\n' 2>/dev/null < "$p/environ" | grep -qx "WINEPREFIX=$COMPAT/pfx" || continue
[ "${p#/proc/}" = "$$" ] && continue
echo "$(date +%H:%M:%S) left over: ${p#/proc/} $(cat "$p/comm" 2>/dev/null)"
kill -9 "${p#/proc/}" 2>/dev/null
@@ -301,6 +324,21 @@ if [ "$verb" != runinprefix ] && prefix_busy; then
fi
prefix_busy || rm -f "$NTSYNC_SHM".v*
# Steam's running client, as a game's steam_api checks it: Proton names its steam.exe (the prefix's first program,
# alive while the game runs), which this tool does not start. Here the first program is the one Steam started, so a
# launcher that starts the game and quits (EU4's dowser.exe) left a game that reported "Steam not detected". The
# PID is the one this tool's own prefixes carry.
steam_pid() {
R=$COMPAT/pfx/user.reg
[ -f "$R" ] || return 0
awk '/^\[/ { on = index($0, "[Software\\\\Valve\\\\Steam\\\\ActiveProcess]") == 1 }
on && /^"PID"=dword:/ && $0 != "\"PID\"=dword:0000fffe" { found = 1 } END { exit !found }' "$R" || return 0
awk '/^\[/ { on = index($0, "[Software\\\\Valve\\\\Steam\\\\ActiveProcess]") == 1 }
on && /^"PID"=dword:/ { print "\"PID\"=dword:0000fffe"; next } { print }' "$R" > "$R.dd-new.$$" && mv -f "$R.dd-new.$$" "$R" &&
echo "$(date +%H:%M:%S) Steam's process ID in the registry set to this tool's"
}
prefix_busy || steam_pid
# Links into a tool that is gone (an older DroidDeck-Bionic, a deleted DroidDeck-Proton) or to a file it no longer has.
# Wine's update cannot write over them, so drivers (network, controller) and other files stay missing. Drop them and
# clear both stamps: prepare_prefix relinks this tool's files and Wine's update puts its own back.
@@ -388,6 +426,59 @@ elif [ -L "$S/ddraw_.dll" ] || [ -e "$S/ddraw_.dll" ]; then
ln -s "$F/lib/wine/i386-windows/ddraw.dll" "$S/ddraw.dll"
echo "$(date +%H:%M:%S) D7VK off: Wine's ddraw again"
fi
# dd-directcontroller: a game set to start without Steam reads the controller through dd-directcontroller's XInput DLLs
# (bionic/dd-directcontroller), which answer from the pad state DroidDeck keeps in each ring file instead of the queue
# of HID reports Wine's xinput reads (a game that reads slower than the pad reports kept moving after the stick
# was let go). They go into the prefix as copies, never through the links to this tool's builtins, with Wine's
# xinput1_4 beside them as dd-directcontroller-wine-xinput.dll for rumble and pass-through. The mode file next to the
# controller folder (DD_DIRECTCONTROLLER_CONTROL, '1' direct / '0' pass-through to Wine's xinput) is read by the DLLs
# while the game runs, so DroidDeck can switch it live; it starts as DD_DIRECTCONTROLLER says (0 = pass-through). A game
# no longer set to start without Steam gets Wine's links back.
DDC=$TOOL/bionic/dd-directcontroller
ddc_names="xinput1_1 xinput1_2 xinput1_3 xinput1_4 xinput9_1_0 xinputuap"
ddc_put() { # src dst: dst becomes a copy of src; a link there is removed first, so the file it names stays as it was
[ ! -L "$2" ] && cmp -s "$1" "$2" && return 0
rm -f "$2" && cp "$1" "$2"
}
ddc_ours() { [ -f "$1" ] && [ ! -L "$1" ] && grep -qF "dd-directcontroller: " "$1"; }
DDCW=$COMPAT/pfx/drive_c/windows
if on "${DROIDDECK_NO_STEAM:-}" && [ -d "$DDC/arm64x" ] && [ -d "$DDC/i386" ]; then
for a in arm64x:system32:aarch64-windows i386:syswow64:i386-windows; do
src=$DDC/${a%%:*}; rest=${a#*:}; dir=$DDCW/${rest%%:*}; wine=$F/lib/wine/${rest#*:}
[ -d "$dir" ] || continue
for n in $ddc_names; do
t=$dir/$n.dll
# a native DLL that is neither Wine's nor ours (a game's own or a tool's) stays, as link_dir keeps it
if [ -f "$t" ] && [ ! -L "$t" ] && ! is_builtin "$t" && ! ddc_ours "$t"; then
echo "$(date +%H:%M:%S) dd-directcontroller: kept ${dir##*/}/$n.dll (not Wine's)"
continue
fi
ddc_put "$src/$n.dll" "$t"
done
ddc_put "$wine/xinput1_4.dll" "$dir/dd-directcontroller-wine-xinput.dll"
done
export WINEDLLOVERRIDES="$WINEDLLOVERRIDES;xinput1_1,xinput1_2,xinput1_3,xinput1_4,xinput9_1_0,xinputuap=n,b"
ddc_mode=1 ddc_name=direct
[ "${DD_DIRECTCONTROLLER:-1}" = 0 ] && ddc_mode=0 ddc_name=pass-through
if [ -n "${FAKE_EVDEV_DIR:-}" ] && echo "$ddc_mode" > "${FAKE_EVDEV_DIR%/*}/dd-directcontroller.mode"; then
export DD_DIRECTCONTROLLER_CONTROL="${FAKE_EVDEV_DIR%/*}/dd-directcontroller.mode"
else
ddc_name="direct (no mode file)"
fi
echo "$(date +%H:%M:%S) dd-directcontroller on (starts $ddc_name)"
else
back=0
for a in system32:aarch64-windows syswow64:i386-windows; do
dir=$DDCW/${a%%:*}; wine=$F/lib/wine/${a#*:}
for n in $ddc_names; do
ddc_ours "$dir/$n.dll" || continue
rm -f "$dir/$n.dll" && ln -s "$wine/$n.dll" "$dir/$n.dll" && back=$((back + 1))
done
rm -f "$dir/dd-directcontroller-wine-xinput.dll"
done
[ $back -gt 0 ] && echo "$(date +%H:%M:%S) dd-directcontroller off: Wine's xinput again"
fi
# A Windows path (an Xbox game on its own drive letter) starts in the folder Steam gave.
case "$EXE" in [A-Za-z]:[\\/]*) ;; *) cd "$(dirname "$EXE")" || exit 1 ;; esac
@@ -403,7 +494,7 @@ comm=$(echo "$name" | cut -c1-15)
game_pids() { # processes of this prefix with the game's name (two prefixes can run programs with the same name)
for p in $(grep -lFx "$comm" /proc/[0-9]*/comm 2>/dev/null); do
p=${p%/comm}
tr '\0' '\n' < "$p/environ" 2>/dev/null | grep -qxF "WINEPREFIX=$COMPAT/pfx" && echo "${p#/proc/}"
tr '\0' '\n' 2>/dev/null < "$p/environ" | grep -qxF "WINEPREFIX=$COMPAT/pfx" && echo "${p#/proc/}"
done
}
# The game's windows go straight to gamescope's X server, as with DroidDeck-Proton (no Wine desktop): the game
+16
View File
@@ -36,6 +36,21 @@ zpath() {
esac
}
# Drive links of the prefix in compatdata folder $1 that name guest paths (DroidDeck-Proton's s: for the Steam library)
# -> their Android paths, which this Wine follows. A game's mods on S: were missing otherwise. A session's start
# gives them their guest paths back (NativeGuest.relinkPrefixDrives); z: is launch.sh's.
android_drives() {
local d t a
for d in "$1"/pfx/dosdevices/[a-y]:; do
[ -L "$d" ] || continue
t=$(readlink "$d")
case "$t" in /*) ;; *) continue ;; esac
a=$(real "$t")
[ "$a" = "$t" ] && continue
ln -sfn "$a" "$d.dd-new.$$" && mv -fT "$d.dd-new.$$" "$d" && echo "drive ${d##*/} -> $a"
done
}
# Where a game launch's log goes in DroidDeck's session folder (Share logs takes that folder): the game's log folder
# when Detailed graphics logs made one (droiddeck-game-env), else a folder of its own; nothing for other verbs
session_logs() {
@@ -109,6 +124,7 @@ print(" ".join(sorted(n for n in names if re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*"
PY
)
export DROIDDECK_BIONIC_KEEP
[ -n "${STEAM_COMPAT_DATA_PATH:-}" ] && android_drives "$STEAM_COMPAT_DATA_PATH" >&2
exec /system/bin/sh "$tool/bionic/launch.sh" "$verb" "$compat" "$exe" ${args[@]+"${args[@]}"} ;;
getcompatpath)
p=$(real "${1:-}")