|
Hermes 0.7.0
Linux game streaming host
|
The Gamescope command line an isolated application session runs. More...
#include <cctype>#include <format>#include <optional>#include <span>#include <string>#include <string_view>Go to the source code of this file.
Classes | |
| struct | platf::gamescope::launch_t |
Enumerations | |
| enum class | platf::gamescope::drm_selector_e { none , prefer_drm , drm_device } |
Functions | |
| std::string_view | platf::gamescope::drm_selector_flag (drm_selector_e selector) |
| bool | platf::gamescope::help_lists_option (std::string_view help, std::string_view option) |
| std::optional< drm_selector_e > | platf::gamescope::drm_selector_from_help (std::string_view help) |
| std::optional< drm_selector_e > | platf::gamescope::drm_selector_from_override (std::string_view value) |
| bool | platf::gamescope::is_primary_card_path (std::string_view path) |
| bool | platf::gamescope::steam_mode_for (std::string_view mode, std::string_view command) |
| std::optional< std::string > | platf::gamescope::session_option_override (std::span< const std::string > arguments) |
| std::string | platf::gamescope::launch_command (const launch_t &launch) |
Variables | |
| constexpr std::string_view | platf::gamescope::default_args {"--expose-wayland --force-windows-fullscreen"} |
| The optional flags an application session gets when its app sets none. | |
The Gamescope command line an isolated application session runs.
Kept free of process and device state, so the parts that decide what Gamescope is told - which scanout option a build understands, what Steam mode changes - can be checked without a Hermes-KMS card or a Gamescope binary.
Definition in file gamescope_session.h.
|
strong |
How a Gamescope build is told which DRM device to scan out on.
Upstream derives its KMS device from the Vulkan device it renders with. An isolated session renders on the real GPU and scans out on its own Hermes-KMS card, which has no Vulkan driver, so it needs a build that takes the two separately. Without one, Gamescope opens the primary node of the GPU it renders with - the card the host's desktop is on.
Definition at line 30 of file gamescope_session.h.
|
inline |
Definition at line 36 of file gamescope_session.h.
|
inline |
The scanout option a build offers, judged from its –help output.
Gamescope prints its usage to stderr, so the caller has to have captured both streams. –prefer-drm wins when a build lists both: it is the one proposed upstream, and the one that validates the device before starting.
Definition at line 74 of file gamescope_session.h.
|
inline |
HERMES_ISOLATED_GAMESCOPE_DRM_FLAG, for a build whose –help does not list the option it accepts. "none" launches without one, which is only useful to reproduce what an unpatched Gamescope does.
Definition at line 89 of file gamescope_session.h.
|
inline |
Whether help text names an option on its own rather than as the start of a longer one, so "--prefer-drm" is not found inside "--prefer-drm-node".
Definition at line 52 of file gamescope_session.h.
|
inline |
Whether path is a DRM primary node, /dev/dri/cardN, which is what both options take. A render node cannot scan out, and anything else would be split into several arguments by run_command().
Definition at line 107 of file gamescope_session.h.
|
inline |
The Gamescope command line for one isolated application session.
It is handed to run_command(), which splits on whitespace and never involves a shell, so every value Hermes places here is a number, a generated connector name, a /dev/dri path or a binary path checked to hold no whitespace; the app's own flags and command are split the same way and quotes are not interpreted.
Steam mode is Gamescope's -e: without it every window's app id is its X id, Steam's base-layer app id never matches, and the overlay stays invisible while it holds the controller. It also gets a second Xwayland, as SteamOS runs it, so the overlay cannot take a game's X focus - Wine games minimize when it does.
The app's flags come after Hermes' Steam-mode flags, so Gamescope's last-one-wins options (–xwayland-count) can override them. The backend, the card, the mode and the connector stay Hermes'.
Definition at line 225 of file gamescope_session.h.
|
inline |
Definition at line 153 of file gamescope_session.h.
|
inline |
Whether an application runs in Gamescope's Steam mode.
mode is the app's gamescope-steam-mode: "on" and "off" decide outright; anything else is auto, which turns it on when the command's program is steam or the shipped launcher, which runs steam -bigpicture (inside a Gamescope session it starts Steam directly). The program is the first whitespace-separated word, as run_command() splits it.
Definition at line 129 of file gamescope_session.h.
|
constexpr |
The optional flags an application session gets when its app sets none.
Definition at line 148 of file gamescope_session.h.