From 0caf9188639fa0963f751e6536aae7ad985a55dc Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Dec 28 2024 09:59:51 +0000 Subject: Clean up & fix Big Picture performance - Drop old muvm (sommelier+hidpipe) codepath - Reinstate -cef-force-occlusion arg for perf fix in Big Picture - Make the launcher hide itself also when started with -gamepadui explicitly --- diff --git a/shim.py b/shim.py index 78b82a9..9bc3364 100644 --- a/shim.py +++ b/shim.py @@ -18,19 +18,12 @@ MANIFEST = [ 'steam-launcher/bootstraplinux_ubuntu12_32.tar.xz', ] -# Drop this for next release -MUVM_IS_NEW = os.path.exists("/usr/bin/muvm-hidpipe") - # prevent user from running as root if os.geteuid() == 0: sys.exit(f"Do not run `{sys.argv[0]}` as root") -if MUVM_IS_NEW: - STEAM_ARGS = [] # x11bridge does not need any of this -else: - # These flags workaround sommelier bugs around both background transparency and - # input. - STEAM_ARGS = ["-cef-force-occlusion", "-cef-force-opaque-backgrounds", "-gamepadui"] +# Performance fix for Big Picture mode +STEAM_ARGS = ["-cef-force-occlusion"] # Append user provided args provided_args = sys.argv[1:] @@ -100,20 +93,7 @@ def is_steam_open(path): with open(tmp, 'w') as f: f.write("not ready") - if MUVM_IS_NEW: - return subprocess.run('xwininfo -tree -root|grep \'"Steam":.*steamwebhelper\'', shell=True).returncode == 0 - - p = muvm(["bash", "-c", f'xwininfo -tree -root|grep \'Steam Big\'; echo $? >{tmp}']) - p.expect(pexpect.EOF) - - while not aborting: - with open(tmp) as f: - ret = f.read().strip() - if ret in ['0', '1']: - return ret == '0' - - time.sleep(1) - + return subprocess.run('xwininfo -tree -root|grep -E \'Steam Big|"Steam":.*steamwebhelper\'', shell=True).returncode == 0 aborting = False @@ -127,17 +107,6 @@ def watch_steam(path): steam = None -# Start hidpipe-server and give it long enough to warm up. This is a bit of a -# hack. TODO: We'll move this into muvm -def start_hidpipe(): - import subprocess - try: - hidpipe = subprocess.Popen(["hidpipe-server"]) - time.sleep(1) - return hidpipe - except OSError: - return None - def launch_steam(path): global steam global aborting @@ -146,11 +115,6 @@ def launch_steam(path): if not is_latest_installed(path): download(URL, path) - if MUVM_IS_NEW: - hidpipe = None - else: - hidpipe = start_hidpipe() - # Launch steam steam_arg_string = ' '.join(STEAM_ARGS) steam = muvm(["FEXBash", "-c", f'{path}/steam-launcher/bin_steam.sh {steam_arg_string}']) @@ -174,9 +138,6 @@ def launch_steam(path): except pexpect.exceptions.TIMEOUT: pass - if hidpipe is not None: - hidpipe.kill() - # Here is where we learn Alyssa doesn't know how to write GUIs def splash(path): from PyQt6.QtWidgets import QApplication, QLabel, QWidget, QMainWindow diff --git a/steam.spec b/steam.spec index fd31a65..f58e137 100644 --- a/steam.spec +++ b/steam.spec @@ -24,8 +24,7 @@ Requires: fex-emu Requires: grep Requires: hicolor-icon-theme Requires: lsb_release -Requires: muvm -Requires: (hidpipe if muvm < 0.1.4) +Requires: muvm >= 0.2 Requires: python3 Requires: xwininfo Requires: mesa-fex-emu-overlay-i386