about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--fungus-launcher.py2
-rw-r--r--fungus-proton-manager.py2
-rw-r--r--fungus-run.py2
-rw-r--r--fungus/game_launcher.py22
4 files changed, 24 insertions, 4 deletions
diff --git a/fungus-launcher.py b/fungus-launcher.py
index 4b325d4..9496597 100644
--- a/fungus-launcher.py
+++ b/fungus-launcher.py
@@ -29,6 +29,8 @@ def main() -> None:
 
     if args.verbose:
         set_level(logging.DEBUG)
+    else:
+        set_level(logging.INFO)
 
     from fungus.app import FungusApp
 
diff --git a/fungus-proton-manager.py b/fungus-proton-manager.py
index 3e8a991..ebaf339 100644
--- a/fungus-proton-manager.py
+++ b/fungus-proton-manager.py
@@ -39,6 +39,8 @@ def main() -> None:
 
     if args.verbose:
         set_level(logging.DEBUG)
+    else:
+        set_level(logging.INFO)
 
     apply_dark_theme()
     win = ProtonDownloader()
diff --git a/fungus-run.py b/fungus-run.py
index 7c0bc89..1374026 100644
--- a/fungus-run.py
+++ b/fungus-run.py
@@ -31,6 +31,8 @@ def main() -> None:
 
     if args.verbose:
         set_level(logging.DEBUG)
+    else:
+        set_level(logging.INFO)
 
     from fungus.run_manager import handle_command, load_game
 
diff --git a/fungus/game_launcher.py b/fungus/game_launcher.py
index 68efca6..685b516 100644
--- a/fungus/game_launcher.py
+++ b/fungus/game_launcher.py
@@ -6,6 +6,7 @@ The GTK adapter lives in ``fungus.run_manager``.
 
 from __future__ import annotations
 
+import logging
 import os
 import re
 import signal
@@ -64,7 +65,8 @@ class GameLauncher:
     SANDBOX_ENV_KEYS: tuple[str, ...] = (
         "DRI_PRIME", "__NV_PRIME_RENDER_OFFLOAD",
         "__VK_LAYER_NV_OPTIMUS", "__GLX_VENDOR_LIBRARY_NAME",
-        "GAMEID", "PROTONFIXES_DISABLE", "WINEPREFIX",
+        "GAMEID", "PROTONFIXES_DISABLE", "WINEPREFIX", "WINEDLLOVERRIDES",
+        "UMU_LOG", "PROTON_LOG"
     )
 
     # Predefined bwrap mount entries, grouped by type.
@@ -359,6 +361,13 @@ class GameLauncher:
         self.start_time = time.time()
         os.environ["UMU_RUNTIME_UPDATE"] = "0"
 
+        # TODO make this customizable per-game
+        os.environ["WINEDLLOVERRIDES"] = "winmm=n,b;xgameruntime=n,b"
+
+        if logging.root.level <= logging.DEBUG:
+            os.environ["UMU_LOG"] = "debug"
+            os.environ["PROTON_LOG"] = "1"
+
         if (
             "umu" not in os.environ.get("GAMEID", "")
             and not (os.environ.get("GAMEID", "").isnumeric())
@@ -401,6 +410,7 @@ class GameLauncher:
 
         # Check whitelist
         exec_path = self.game.path
+
         log.debug("sandbox-check: exec_path=%r", exec_path)
         if exec_path and valid_dirs and not self._check_whitelist(exec_path, valid_dirs):
             if self._on_sandbox_warning:
@@ -410,6 +420,9 @@ class GameLauncher:
             self.game, valid_dirs, self.env_from_file,
         )
 
+        log.info(f"final bwrap command: {bwrap_cmd}")
+        log.info(f"sandbox environment: {sandbox_env}")
+
         # ── Launch ──────────────────────────────────────────────────
         run_env = os.environ.copy()
         run_env.update(sandbox_env)
@@ -417,6 +430,8 @@ class GameLauncher:
         full_cmd = bwrap_cmd + inner_cmd
 
         try:
+            # we invoke popen() setting work directory as a dirname() of our executable
+            # this seems to be a common practice for launchers
             self.process = subprocess.Popen(
                 full_cmd,
                 stdout=subprocess.PIPE,
@@ -424,6 +439,7 @@ class GameLauncher:
                 bufsize=8192,
                 text=True,
                 env=run_env,
+                cwd=os.path.dirname(exec_path)
             )
         except (FileNotFoundError, OSError) as exc:
             error_msg = (
@@ -581,9 +597,7 @@ class GameLauncher:
         if not clean_line:
             return
 
-        log.debug("_on_io_line: [%s] %s", "err" if is_stderr else "out", clean_line)
-
-
+        # log.debug("_on_io_line: [%s] %s", "err" if is_stderr else "out", clean_line)
 
         # Dispatch to callback
         if self._on_output_line: