about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--fungus/game_launcher.py10
-rw-r--r--fungus/run_manager.py6
2 files changed, 15 insertions, 1 deletions
diff --git a/fungus/game_launcher.py b/fungus/game_launcher.py
index d696fd5..d8460cb 100644
--- a/fungus/game_launcher.py
+++ b/fungus/game_launcher.py
@@ -566,6 +566,7 @@ class GameLauncher:
         # Check for game-running signals — signal the adapter to close
         if self._detect_game_running(clean_line):
             if self._on_splash_close:
+                log.debug("invoking splash-close callback")
                 self._on_splash_close()
 
         log.info("%s", line.rstrip())
@@ -590,7 +591,14 @@ class GameLauncher:
             "Executable a unix path", "status: 0",
             "PosixPath", "SingleInstance", "mtree is OK",
         ]
-        return any(signal in clean_line for signal in game_running_signals)
+        for pattern in game_running_signals:
+            if pattern in clean_line:
+                log.debug(
+                    "game-running signal detected: %r in %r",
+                    pattern, clean_line,
+                )
+                return True
+        return False
 
     # ── Signal handlers ───────────────────────────────────────────────
 
diff --git a/fungus/run_manager.py b/fungus/run_manager.py
index b0e6275..c9fa3c2 100644
--- a/fungus/run_manager.py
+++ b/fungus/run_manager.py
@@ -115,6 +115,7 @@ def handle_command(
         log.error("GameLauncher error: %s", msg)
 
     def on_process_exit() -> None:
+        log.debug("on_process_exit: closing splash and quitting GTK")
         s = splash_container[0]
         if s is not None:
             GLib.idle_add(s.close)
@@ -141,6 +142,7 @@ def handle_command(
         Called from the I/O watch thread when a game-running signal
         (e.g. "fsync") is detected in the output.
         """
+        log.debug("_on_splash_close: scheduling splash close")
         s = splash_container[0]
         if s is not None and hasattr(s, 'close'):
             GLib.idle_add(s.close)
@@ -203,6 +205,10 @@ def handle_command(
             Calls launcher.cleanup() to stop the watchdog, save playtime,
             close the splash window, and quit GTK.
             """
+            log.debug(
+                "_on_child_exit: pid=%d condition=%d — calling launcher.cleanup()",
+                pid, condition,
+            )
             launcher.cleanup()
             return False