From 2c2a74feaab3dddd2b243dc8cd2d1db9f2345f80 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Wed, 16 Sep 2026 22:15:00 +0500 Subject: [PATCH] fix: preload GameMode library instead of calling system gamemoderun Signed-off-by: Boris Yumankulov --- .../share/portproton/scripts/functions_helper | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/build-aux/share/portproton/scripts/functions_helper b/build-aux/share/portproton/scripts/functions_helper index 7001aa1d..72946763 100755 --- a/build-aux/share/portproton/scripts/functions_helper +++ b/build-aux/share/portproton/scripts/functions_helper @@ -2592,21 +2592,16 @@ pw_enable_gamemode_basic () { if check_flatpak ; then export GAMEMODERUN=1 PW_GAMEMODERUN_SLR="gamemoderun" - elif command -v gamemoderun &>/dev/null ; then - export GAMEMODERUN=1 - PW_GAMEMODERUN_SLR="gamemoderun" - if command -v gamemoded &>/dev/null && ! pw_is_process_active gamemoded ; then - gamemoded &>/dev/null & - sleep 0.1 - fi else export GAMEMODERUN=1 - if [[ -n "${PW_LD_PRELOAD}" ]]; then - export PW_LD_PRELOAD="${PW_LD_PRELOAD}:libgamemodeauto.so.0" - else - export PW_LD_PRELOAD="libgamemodeauto.so.0" - fi - if ! pw_is_process_active gamemoded ; then + local GAMEMODEAUTO_NAME="libgamemodeauto.so.0" + export PW_LD_PRELOAD="${GAMEMODEAUTO_NAME}${PW_LD_PRELOAD:+:$PW_LD_PRELOAD}" + if command -v gamemoderun &>/dev/null ; then + if command -v gamemoded &>/dev/null && ! pw_is_process_active gamemoded ; then + gamemoded &>/dev/null & + sleep 0.1 + fi + elif ! pw_is_process_active gamemoded ; then env LD_LIBRARY_PATH="${PW_PLUGINS_PATH}/portable/lib/lib64:${PW_PLUGINS_PATH}/portable/lib/lib32" \ "${PW_PLUGINS_PATH}/portable/bin/gamemoded" &>/dev/null & sleep 0.1 -- 2.54.0