about summary refs log tree commit diff stats
path: root/fungus/game_launcher.py
diff options
context:
space:
mode:
Diffstat (limited to 'fungus/game_launcher.py')
-rw-r--r--fungus/game_launcher.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/fungus/game_launcher.py b/fungus/game_launcher.py
index fb0806d..68efca6 100644
--- a/fungus/game_launcher.py
+++ b/fungus/game_launcher.py
@@ -38,9 +38,14 @@ log = get_logger(__name__)
 
 @dataclass
 class LaunchHandle:
-    """Handle for a launched process (for GLib watches)."""
+    """Handle for a launched process (for GLib watches).
 
-    process: subprocess.Popen
+    ``process`` is ``None`` when launch was skipped due to validation
+    failure (missing Steam Runtime, missing Proton, spawn error).  In
+    those cases the GTK adapter has already been notified via callbacks.
+    """
+
+    process: subprocess.Popen | None
     pid: int
 
 
@@ -366,7 +371,7 @@ class GameLauncher:
                 self._on_splash_close()
             if self._on_steam_runtime_missing:
                 self._on_steam_runtime_missing()
-            return LaunchHandle(subprocess.Popen([]), 0)  # dummy
+            return LaunchHandle(None, 0)
 
         if proton_dir and not self._check_proton_path():
             if not has_proton_installed():
@@ -374,13 +379,13 @@ class GameLauncher:
                     self._on_splash_close()
                 if self._on_proton_missing:
                     self._on_proton_missing()
-                return LaunchHandle(subprocess.Popen([]), 0)  # dummy
+                return LaunchHandle(None, 0)
 
             if self._on_splash_close:
                 self._on_splash_close()
             if self._on_proton_path_missing:
                 self._on_proton_path_missing(proton_dir)
-            return LaunchHandle(subprocess.Popen([]), 0)  # dummy
+            return LaunchHandle(None, 0)
 
         # ── Load env file ───────────────────────────────────────────
         self.env_from_file = self.load_env_from_file(envar_dir)
@@ -427,7 +432,7 @@ class GameLauncher:
             )
             if self._on_spawn_error:
                 self._on_spawn_error(error_msg)
-            return LaunchHandle(subprocess.Popen([]), 0)  # dummy
+            return LaunchHandle(None, 0)
 
         if self._on_process_started:
             self._on_process_started()