click: macOS-pgrep-Rueckfall reisst unter Windows nicht mehr den Laeufer

window_rect fiel bei fehlendem Tischfenster auf pgrep zurueck; unter Windows
gibt es das nicht (FileNotFoundError) - die Ausnahme riss den ganzen Laeufer
und alle Tische (live 13.11., bisher nur uncommittet im Engine-Worktree).
Jetzt None = dieser eine Zug wird uebersprungen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 23:08:40 +01:00
co-authored by Claude Opus 5.5
parent 696319c13b
commit e39808ffd8
+12 -2
View File
@@ -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]})'