From 03749b9687f149fa622746e839a216368326dd0e Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Thu, 29 Aug 2024 23:45:27 +0100 Subject: [PATCH] GameScope: Only add internal and show resolution if width and height values are valid --- steamtinkerlaunch | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index 43e74193..c93c5934 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -7,7 +7,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v14.0.20240829-2 (gamescope-use-getgamescopearg-for-gsshwres-gsintres)" +PROGVERS="v14.0.20240829-3 (gamescope-use-getgamescopearg-for-gsshwres-gsintres)" PROGCMD="${0##*/}" PROGINTERNALPROTNAME="Proton-stl" SHOSTL="stl" @@ -11825,19 +11825,25 @@ function GameScopeGui { # Build the GameScope arguments string unset GAMESCOPE_ARGS + GAMESCOPE_ARGS="" + + # Internal width/height (-w, -h) broken out from string like '1280x720' + # NOTE: In future if `GSINTW` is blank but `GSINTH` is set, we could calculate a corresponding 16:9 width like GameScope does GSINTW1="${GSINTRES%x*}" GSINTW="${GSINTW1%%-*}" GSINTH1="${GSINTRES#*x}" GSINTH="${GSINTH1%%-*}" - GAMESCOPE_ARGS="-w ${GSINTW} -h ${GSINTH}" + # Show width/height (-W, -H) broken out from string like '1280x720' + # NOTE: In future if `GSINTW` is blank but `GSINTH` is set, we could calculate a corresponding 16:9 width like GameScope does GSSHWW1="${GSSHWRES%x*}" GSSHWW="${GSSHWW1%%-*}" GSSHWH1="${GSSHWRES#*x}" GSSHWH="${GSSHWH1%%-*}" - GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -W ${GSSHWW} -H ${GSSHWH}" ### GENERAL OPTIONS ### + if [ -n "$GSINTW" ] && [ -n "$GSINTH" ] ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -w ${GSINTW} -h ${GSINTH}"; fi + if [ -n "$GSSHWW" ] && [ -n "$GSSHWH" ] ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -W ${GSSHWW} -H ${GSSHWH}"; fi if [ "$GSFLR" -eq "$GSFLR" ] 2>/dev/null ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -r ${GSFLR}"; fi if [ "$GSFLU" -eq "$GSFLU" ] 2>/dev/null ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -o ${GSFLU}"; fi if [ "$GSFS" == "TRUE" ] ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -f"; fi