Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GameScope: Append '--' to end of GAMESCOPEARGSARR if it is missing #1050

Merged
merged 2 commits into from Mar 6, 2024

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented Mar 6, 2024

Fixes #1048.
Follow-up to #1049.

Very similar to #1049, except this handles the case where the given GameScope arguments string that we want to break up into GAMESCOPEARGSARR (which ultimately gets passed to the launch command) does not end with --. This causes the same problem as if the arguments are blank: the GameScope command is not properly terminated.

ShellCheck is good on this at time of writing but I want to do some more testing (such as with whitespaces and such after the args string to see how we handle that).

@sonic2kk
Copy link
Owner Author

sonic2kk commented Mar 6, 2024

Tested and this works with the following GameScope arg strings:

  • -w 1280 -h 720 -W 1280 -H 720 -f -- - valid args with -- at the end as it should normally be by default, and also when edited from the GameScope GUI.
  • -w 1280 -h 720 -W 1280 -H 720 -f - valid args, but missing -- at the end, so invalid syntax. This kind of case would only arise if the args were manually entered/edited. This PR catches this case and appends -- at the end.
  • `` - Empty string, correctly handled.
  • none - This is what actually gets saved to GAMESCOPE_ARGS config var if the args are blank after saving, but this was tested with the above by going to the Game Menu -> Deleting all GameScope args so the textbox was blank -> Save and Play (success) -> Close and relaunch game -> Go to Game Menu -> GameScope args were none -> Save and Play (success).

I tested the arguments with a ton of whitespaces and they do break, but I think it's up to the user to make sure they format the args correctly. Appending -- is just a convenience, trying to handle formatting the spacing between flags would add a lot of complexity especially when it comes to paths. So for now, we will leave this.


Now that testing is done, this is ready to merge after a version bump.

@sonic2kk sonic2kk merged commit c2071ea into master Mar 6, 2024
@sonic2kk sonic2kk deleted the gamescope-args-incorrect-ending-fix branch March 7, 2024 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enableing gamescope crashes games
1 participant