Skip to content

feat: no sleep while playing, Flatpak autostart, game tools and known fixes - #32

Merged
TheBiemGamer merged 4 commits into
mainfrom
feat/launch-extras
Nov 26, 2026
Merged

TheBiemGamer merged 4 commits into
mainfrom
feat/launch-extras

Conversation

@TheBiemGamer

Copy link
Copy Markdown
Owner

Four launch extras, in one commit each.

Keep the PC awake while a game runs

  • Windows: SetThreadExecutionState (system + display) held on its own thread. Linux: the desktop portal's Inhibit (idle) over zbus, which works in the Flatpak without a talk-name.
  • The poll takes the hold while a game runs (Steam's, the watched one, or a Play setting up) and drops it when the game ends. If Guild exits or crashes, the hold ends with its thread or bus connection.
  • Linux asks for idle only. Idle also stops idle suspend, like Windows' request. The gtk portal backend refuses the suspend flag, and that flag would also block a suspend the owner asks for.
  • No Settings switch: it's always on.

Start on login in the Flatpak (Background portal)

  • In a Flatpak the Start on login switch shows again. It calls org.freedesktop.portal.Background.RequestBackground with autostart and guild --minimized, and keeps the answer in settings, because the host's autostart entry is out of reach. If the desktop says no, the switch flips back with a message.
  • Outside the Flatpak nothing changes (tauri-plugin-autostart).

Gamescope, MangoHud and GameMode (Linux)

  • Settings → Wine → Game tools: one switch per tool, off by default. A game's Launch options get a Default / On / Off menu per tool, stored with its other launch options (the launch_options JSON in game_prefs). The table schema doesn't change, so there's no migration step.
  • Wrapper order, outermost first: gamescope -f [--mangoapp] --, mangohud --dlsym (without gamescope), gamemoderun, then umu-run (Windows games) or the game's own program (native GOG builds).
  • A tool that isn't on PATH shows a disabled switch or chip with "Not installed". In the Flatpak the row names the Flathub extension to install instead. The manifest adds the MangoHud and gamescope VulkanLayer paths to PATH, plus xdg-run/gamescope-0 and xdg-config/MangoHud:ro. gamemoderun comes from the runtime.

Heroic known fixes

  • known_fixes.json is cached in info (kind known-fixes) for a day. A stale list is used and refreshed in the background. A Play with no cached list at all fetches it first (5 s at most). Failures only log.
  • Matching is by the store's own id (epic/gog/amazon → app name / product id), never by title. Only envVariables are applied (today 8 Epic games, all USE_FAKE_EPIC_EXE). A variable the launch already sets, or that Guild was started with, wins. Winetricks verbs and runInPrefix installers are left out: they mean long downloads during a Play, and umu's protonfixes already cover many of those games.

Tested

  • Every commit passes cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test, npm run check, npm test and npx prettier --check ..
  • Unit tests cover the wrapper order, the per-game choice over the setting, and known-fix matching.
  • Ran against the real portal on dev (xdg-desktop-portal + gtk backend, headless): Inhibit and Close go through. Fetched the live known-fixes list.
  • Not tested: a Windows build (CI covers it), the Background portal (no backend for it on dev), and Gamescope, MangoHud, GameMode or the Flatpak with a real GPU and desktop.

🤖 Generated with Claude Code

Windows holds SetThreadExecutionState on its own thread; Linux holds the
desktop portal's Inhibit (idle and suspend) over zbus, which also works in
the Flatpak. The poll takes the hold while a game runs and drops it when the
game ends; Guild exiting ends it with its thread or bus connection.
The sandbox can't write the host's autostart folder, so the switch was
hidden. In a Flatpak it now asks the desktop portal's Background interface
(autostart with guild --minimized) and keeps the answer in settings, since
the entry it writes is out of reach. Outside the Flatpak nothing changes.
Settings -> Wine gets a switch per tool (off by default) and a game's
Launch options a Default / On / Off menu per tool, kept with its other
launch options in game_prefs. Windows games wrap umu-run, native Linux
builds their own program. A tool that isn't on PATH shows disabled with
the reason; the Flatpak finds MangoHud and gamescope in their Flathub
Vulkan layer extensions and gamemoderun in the runtime.
The community list's environment variables for a game, matched by the
store's own id, are set before it runs through umu. The list is cached in
info (kind known-fixes) for a day and refreshed behind a Play once stale;
a variable the launch or Guild's own environment already sets wins. Its
winetricks verbs and installers are left out.
@TheBiemGamer
TheBiemGamer merged commit 2befc07 into main Nov 26, 2026
3 checks passed
@TheBiemGamer
TheBiemGamer deleted the feat/launch-extras branch November 26, 2026 18:50
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.

1 participant