From 59c746b3fed99bcfc7dcb0d8c19accfda6754d20 Mon Sep 17 00:00:00 2001 From: rickpeters Date: Sun, 27 Sep 2026 17:44:38 +0200 Subject: [PATCH] fix(ui): Started from Steam, the app runs without Steam's overlay (Qt aborted) and stays in the foreground, so Steam Input gives it the controller --- ui/steamify-app.sh | 5 +++++ ui/steamify-ui | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ui/steamify-app.sh b/ui/steamify-app.sh index c77f21c..95f428b 100755 --- a/ui/steamify-app.sh +++ b/ui/steamify-app.sh @@ -71,4 +71,9 @@ EOF command -v update-desktop-database >/dev/null && update-desktop-database "$APPS" 2>/dev/null || true say "Starting Steamify..." +# Started from Steam: stay in the foreground, or Steam counts the game as +# ended right away and stops giving it the controller. +if [[ -n "${SteamGameId:-}" ]]; then + exec "$DEST/ui/steamify-ui" < /dev/null +fi setsid "$DEST/ui/steamify-ui" >/dev/null 2>&1 < /dev/null & diff --git a/ui/steamify-ui b/ui/steamify-ui index 8fa4310..8da4519 100755 --- a/ui/steamify-ui +++ b/ui/steamify-ui @@ -20,6 +20,14 @@ import tempfile import threading import time +# Started from Steam (a non-Steam game, so Steam Input hands it the +# controller): Steam preloads its overlay into every game, and Qt aborts with +# it loaded. Start again without it, before Qt is imported. +if "gameoverlayrenderer" in os.environ.get("LD_PRELOAD", ""): + os.environ["LD_PRELOAD"] = ":".join(p for p in os.environ["LD_PRELOAD"].split(":") + if p and "gameoverlayrenderer" not in p) + os.execv(sys.executable, [sys.executable] + sys.argv) + HERE = os.path.dirname(os.path.realpath(__file__)) try: