From 74ff7899c46a5dd95a4047c77a660ce8bd1f0c5c Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Mon, 25 Mar 2024 16:43:43 -0700 Subject: [PATCH] Adapt winekill for umu --- lutris/runners/commands/wine.py | 28 ++++++++++++++-------------- lutris/runners/wine.py | 5 ++++- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lutris/runners/commands/wine.py b/lutris/runners/commands/wine.py index 9f79b2c1c..5d8359224 100644 --- a/lutris/runners/commands/wine.py +++ b/lutris/runners/commands/wine.py @@ -177,22 +177,22 @@ def winekill(prefix, arch=WINE_DEFAULT_ARCH, wine_path=None, env=None, initial_p """Kill processes in Wine prefix.""" initial_pids = initial_pids or [] - - if not wine_path: - if not runner: - runner = import_runner("wine")() - wine_path = runner.get_executable() - wine_root = os.path.dirname(wine_path) if not env: - env = {"WINEARCH": arch, "WINEPREFIX": prefix} - command = [os.path.join(wine_root, "wineserver"), "-k"] - - logger.debug("Killing all wine processes: %s", command) - logger.debug("\tWine prefix: %s", prefix) - logger.debug("\tWine arch: %s", arch) - if initial_pids: - logger.debug("\tInitial pids: %s", initial_pids) + env = {"WINEARCH": arch, "WINEPREFIX": prefix} + if proton.is_proton_path(wine_path): + command = [proton.get_umu_path(), "runinprefix", "wineboot", "-e"] + env["GAMEID"] = proton.DEFAULT_GAMEID + else: + if not wine_path: + if not runner: + runner = import_runner("wine")() + wine_path = runner.get_executable() + wine_root = os.path.dirname(wine_path) + command = [os.path.join(wine_root, "wineserver"), "-k"] + logger.debug("Killing all wine processes (%s) in prefix %s: %s", initial_pids, prefix, command) + logger.debug(command) + logger.debug(" ".join(command)) system.execute(command, env=env, quiet=True) logger.debug("Waiting for wine processes to terminate") diff --git a/lutris/runners/wine.py b/lutris/runners/wine.py index 01fb67ffb..268e136c7 100644 --- a/lutris/runners/wine.py +++ b/lutris/runners/wine.py @@ -933,6 +933,7 @@ class wine(Runner): def run_winekill(self, *args): """Runs wineserver -k.""" + winekill( self.prefix_path, arch=self.wine_arch, @@ -1147,7 +1148,9 @@ class wine(Runner): exe = wine_path or self.get_executable() except MisconfigurationError: return set() - + if proton.is_proton_path(exe): + logger.debug("Tracking PIDs of Proton games is not possible at the moment") + return set() if not exe.startswith("/"): exe = system.find_required_executable(exe) pids = system.get_pids_using_file(exe)