diff --git a/hand/click.py b/hand/click.py index 0915afc2..076be2fc 100644 --- a/hand/click.py +++ b/hand/click.py @@ -83,8 +83,18 @@ def osa(script): def window_rect(): - pids = subprocess.run(["pgrep", "-f", "CoinPoker Game"], capture_output=True, - text=True).stdout.split() + # Globaler Fallback "erstes CoinPoker-Fenster" - rein macOS (pgrep + osascript/System Events). + # Auf Windows gibt es weder pgrep (FileNotFoundError, WinError 2) noch dieses globale Fenster-1- + # Konzept: der Tisch-Rect kommt dort IMMER ueber fenster.fenster_fuer (winfenster) als `f`. Faellt + # act.ausfuehren mangels `f` hierher (verdecktes/fehlendes Fenster), ist None richtig = der eine Zug + # wird uebersprungen, statt dass pgrep den GANZEN Laeufer reisst und alle Tische verliert (13.11.). + if sys.platform != "darwin": + return None + try: + pids = subprocess.run(["pgrep", "-f", "CoinPoker Game"], capture_output=True, + text=True).stdout.split() + except OSError: + return None if not pids: return None proc = f'(first process whose unix id is {pids[0]})'