From 0b0ec600ab77e2c5b9b68d9db38f3f08f1be0ffb Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Dec 04 2024 13:02:47 +0000 Subject: Updates for new muvm - Start up in non-big-picture mode if muvm is new enough - Drop CEF workarounds if muvm is new enough - Fix bug with the launcher window remaining up after Steam - Make hidpipe dep optional for newer muvm --- diff --git a/shim.py b/shim.py index 245caf9..78b82a9 100644 --- a/shim.py +++ b/shim.py @@ -6,6 +6,7 @@ from xdg import BaseDirectory import sys import os import pexpect +import subprocess import time LAUNCHER_NAME = 'fex-steam' @@ -17,13 +18,19 @@ 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") -# These flags workaround sommelier bugs around both background transparency and -# input. -STEAM_ARGS = ["-cef-force-occlusion", "-cef-force-opaque-backgrounds", "-gamepadui"] +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"] # Append user provided args provided_args = sys.argv[1:] @@ -93,6 +100,9 @@ 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) @@ -113,6 +123,7 @@ def watch_steam(path): global aborting while not steam_is_ready and not aborting: steam_is_ready = is_steam_open(path) + time.sleep(0.1) steam = None @@ -135,7 +146,10 @@ def launch_steam(path): if not is_latest_installed(path): download(URL, path) - hidpipe = start_hidpipe() + if MUVM_IS_NEW: + hidpipe = None + else: + hidpipe = start_hidpipe() # Launch steam steam_arg_string = ' '.join(STEAM_ARGS) @@ -248,24 +262,25 @@ def splash(path): print("Steam is up - hiding the launcher") window.hide() timer.timeout.disconnect() - sys.exit(0) + app.quit() exiting = steam_is_ready def abort(): + nonlocal exiting global aborting + if exiting: + return # If Steam is not ready, this is an early-exit. # If Steam is ready, this is just Qt tidying up after we closed the window. # We can sys.exit, Steam is in a helper thread. aborting = not steam_is_ready print(f"Qt says we're gone, aborting={aborting}") - sys.exit(0) app.aboutToQuit.connect(abort) timer.timeout.connect(update) timer.start(1000) app.exec() - print(f"We're dead, Jim.") # Ok. Time to kick everything off. # Grab our data directory, xdg compliant diff --git a/steam.spec b/steam.spec index 499649f..fd31a65 100644 --- a/steam.spec +++ b/steam.spec @@ -1,6 +1,6 @@ Name: steam Version: 0 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Steam wrapper for Fedora Asahi Remix License: MIT @@ -25,7 +25,7 @@ Requires: grep Requires: hicolor-icon-theme Requires: lsb_release Requires: muvm -Requires: hidpipe +Requires: (hidpipe if muvm < 0.1.4) Requires: python3 Requires: xwininfo Requires: mesa-fex-emu-overlay-i386 @@ -70,6 +70,11 @@ appstream-util validate-relax --nonet \ %{_metainfodir}/io.pagure.fedora_asahi.steam.metainfo.xml %changelog +* Wed Dec 04 2024 Asahi Lina - 0-13 +- Start up in non-big-picture mode if muvm is new enough +- Drop CEF workarounds if muvm is new enough +- Fix bug with the launcher window remaining up after Steam + * Tue Nov 12 2024 Asahi Lina - 0-12 - Depend on zenity (which Steam uses)