feat(linux): start the game through gamescope, with any of its options #227
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!227
Loading…
Reference in a new issue
No description provided.
Delete branch "dazemc/LongshotLauncher:feat/gamescope-launch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Players who run other games under gamescope (HDR output, VRR, resolution scaling, a frame cap, full screen on a TV or Deck) have no way to start Longshot that way from the launcher: Play always starts the game bare. The only workaround is a hand-written wrapper script outside the launcher.
What
On Linux, Settings gains a Gamescope section:
-W 3840 -H 2160 -r 164 -f --hdr-enabled --rt --force-grab-cursor.When the tick is on, Play starts
with the same environment and working directory the game always gets (
GamePlay.Environment). Options are split into words: spaces separate,'…'and"…"group, and a backslash escapes the next character outside quotes. Inside double quotes, it escapes only$, backtick,", backslash and newline (so--scaler "fit -"anda\ bwork). Windows is unaffected, and a settings file shared with a Windows machine is harmless (the setting is ignored there).Files:
Core/LauncherSettings.cs—Gamescope,GamescopeOptionsCore/MakeGameCommand.cs—GamePlay.SplitOptionsand the wrap inStartInfoApp/LauncherService.cs— passes the setting when Play starts a buildApp/ViewModels/SettingsViewModel.cs,App/Views/SettingsView.axaml— the Settings sectiontests/launcher_core/GamescopeChecks.cs— the checksTested on this PC
Arch Linux, Hyprland (Wayland), RTX 4070 Ti (driver 620.70.06), gamescope 3.16.25, a launcher built from this branch, a game built by the launcher (v3.0.0).
Set the tick on with
-W 3840 -H 2160 -r 164 -f --hdr-enabledand started the game through the launcher's own Play path (--play, which goes throughLauncherService.PlayFolder). The process it started:The game booted inside it:
crash window: off under gamescope (the Steam Deck's Game Mode), gamescope'sHDR INFO cv_hdr_enabled: true/uMaxLum: 2500, uRefLum: 203, and Longshot's window at 2560x1440. With the tick off the launcher starts the game itself, as before.Checks
dotnet build App/LongshotLauncher.csproj -c Release— 0 warnings, 0 errors.tests/launcher_core/GamescopeChecks.cs: the splitting cases (quotes, escapes, empty quoted word, blank input) and the exact command, plus gamescope off and Windows (never wrapped). The updated checks are pending.python -I tests/test_launcher_core.py: fails inUnlistedCheckson this branch and on unmodifiedmain, same message (got: dev stable (2) v3.0.0-rc.4 v3.0.3); verified by stashing the change. Not caused here.tests/test_release.py(LAUNCHER=$PWD): 3 failures (test_the_bump,test_the_next_stable,test_check_tag_against_the_published_releases), the same list onmainand on this branch.Not included
Tested end to end on this PC: with the tick on, Play started gamescope -- --user ; the game booted under gamescope with its Game Mode path and HDR. Checks and the two pre-existing suite failures (identical on main) are in the description.
WIP: feat(linux): start the game through gamescope, with any of its optionsto feat(linux): start the game through gamescope, with any of its options@review
Recommendation: Request changes. The new options field can change valid arguments before gamescope receives them, so some configurations do not work as advertised. The reported Linux run demonstrates the basic launch path, but the input handling needs correction.
Adds an off-by-default Linux setting to start Longshot through gamescope with player-supplied options. It enables the demonstrated HDR launch, at the cost of maintaining an option parser and exposing its input errors to players.
@fixwill do (3)Core/MakeGameCommand.cs:269: Inside double quotes, a shell preserves a backslash before ordinary characters, but this removes it. (more on the line)App/ViewModels/SettingsViewModel.cs:276: Trimming the stored text changes valid shell-style input: a final escaped space, such as a\ , becomes a trailing backslash and produces a different argument. (more on the line)Checks: Still running:
CI / Conventional Commit title (pull_request),CI / Compile and test (pull_request).More: does it help, other systems, switches, what was read
Does it help: Yes for the demonstrated configuration: the author reports that a launcher build started the game under gamescope 3.16.25 with HDR on Arch Linux and an RTX 4070 Ti. Other option parsing cases remain incorrect; this is not a performance claim.
Other systems: The wrapper applies only on Linux. Windows ignores the setting, and the existing game environment and working directory are retained. The reported run covers Wayland and NVIDIA; Steam Deck, other compositors and GPU vendors were not reported tested.
Switches: Gamescope is added, default off, which preserves existing launches. GamescopeOptions is added, default empty, leaving gamescope's defaults in effect. Both are launcher settings, not environment switches.
Reviewed:
28c039f3b7againste2220601db: Read the repository rules, commit, diff, changed settings, view, launch command and gamescope checks, and surrounding Play callers and error handling. The large LauncherService.cs and tests/launcher_core/Program.cs were skimmed outside the changed paths; no review checklist or pull request template was found. No recorded runs or generated files were changed.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code or tests were run. CI compile-and-test and title checks were still running in the supplied status.
Overlaps and merge order: None found in the supplied context.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -256,0 +273,4 @@get => s.GamescopeOptions ?? "";set{s.GamescopeOptions = string.IsNullOrWhiteSpace(value) ? null : value.Trim();L2: Trimming the stored text changes valid shell-style input: a final escaped space, such as a\ , becomes a trailing backslash and produces a different argument. Store the text as entered and let the parser handle whitespace; add a check through the settings path.
@ -252,0 +266,4 @@{if (c == quoted) quoted = '\0';else if (c == '\\' && quoted == '"' && i + 1 < options.Length) word.Append(options[++i]);else word.Append(c);L1: Inside double quotes, a shell preserves a backslash before ordinary characters, but this removes it. For example, an option value typed as "a\b" reaches gamescope as ab instead of a\b. Preserve the backslash except before characters for which double-quoted shell escaping applies, and cover that case in the checks.
@fix
28c039f3b765418c8e8bRecommendation: Approve. The gamescope feature has a reported successful Linux launch, but the updated settings and option parsing checks have not yet run. The required screenshot of the new settings section is also still missing. Nothing blocking is left. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
65418c8e8b. I rebased it ontomain(5f16dcd74e). I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
Adds an optional Linux gamescope wrapper with configurable arguments; it is off by default and ignored on Windows. It gives players access to gamescope features at the cost of maintaining an argument parser and an additional settings section.
@fixwill do (1)Checks: they run again on this head; a failure shows on the pull request.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes for the feature: the author reports that Longshot booted through gamescope with HDR on Arch Linux. The updated automated checks are pending; this is not a performance change.
Other systems: Windows ignores the gamescope setting. Linux launches retain the game environment and working directory; the reported end-to-end run covers one NVIDIA Wayland setup, not other drivers or desktop environments.
Switches: Adds Gamescope, off by default, and GamescopeOptions, empty by default. The opt-in default preserves existing launches.
Reviewed:
65418c8e8bagainst5f16dcd74e: Read the repository rules, the posted description and reviews, the gamescope parser and launch path, settings setter, new app and core checks, test runner changes, and project build settings. The full base-to-head diff is much larger than the listed feature and was only skimmed; other changed files and assets were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. The author reports a successful Linux launch and earlier build; CI and the updated checks are pending. The description reports existing suite failures on both main and the branch.
Overlaps and merge order: none found
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.