RFC: Add option to use gamescope in behalf of clients #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The launcher is responsible for subreaping in behalf of clients, however, we're not able to fullfill that responsibility if gamescope is used which will cause their users' games to not run when the game had exited improperly (e.g, closing the game window, control+c, etc.). As a result, clients are required to handle killing the zombie wine processes themselves which will require a proper subreaping system in place to do effectively.
However, by giving clients the option to use gamescope via ULWGL, we can ensure all zombie processes are killed for the client via systemd when the user exits their game improperly.
Usage
To use systemd as the subreaper instead of Reaper, clients must set
ULWGL_SYSTEMD=1
. Example:To use gamescope, set
ULWGL_GAMESCOPE=1
and optionally write the gamescope options to~/.local/share/ULWGL/state/ulwgl-$ULWGL_ID.json
for the launcher to read. Example:After optionally defining the gamescope options, run:
Complete usage
Systemd is required to ensure all lingering processes are killed when the game exits improperly when using gamescope. Therefore, to take full advantage of this feature, run:
> WINEPREFIX=... PROTONPATH=... GAMEID=... ULWGL_GAMESCOPE=1 ULWGL_SYSTEMD=1 ulwgl-run ...
Or when using a configuration file: