From 99d2083dea3d36bc023aa8004f4e986c2563c7d3 Mon Sep 17 00:00:00 2001 From: Dom Date: Wed, 22 Apr 2026 20:06:55 +0200 Subject: [PATCH] =?UTF-8?q?fix(ORA):=20moveTo=20+=20pause=20+=20click=20+?= =?UTF-8?q?=20pause=20+=20Win+D=20(s=C3=A9quence=20valid=C3=A9e=20par=20Do?= =?UTF-8?q?m)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- core/execution/observe_reason_act.py | 34 +++++++++------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/core/execution/observe_reason_act.py b/core/execution/observe_reason_act.py index eaffe335b..3806c8336 100644 --- a/core/execution/observe_reason_act.py +++ b/core/execution/observe_reason_act.py @@ -926,29 +926,17 @@ Règles: pyautogui.hotkey('super', 'd') time.sleep(1.0) else: - # Pas de dialogue connu → fenêtre devant → focus VM + Win+D - print(f"🔧 [ORA/recovery/overlay] Fenêtre devant — focus VM + Win+D") - try: - # Trouver la fenêtre QEMU/VM et lui donner le focus - result = subprocess.run( - ['xdotool', 'search', '--name', 'QEMU'], - capture_output=True, text=True, timeout=2 - ) - vm_windows = result.stdout.strip().split('\n') - if vm_windows and vm_windows[0]: - subprocess.run(['xdotool', 'windowactivate', vm_windows[0]], timeout=2) - time.sleep(0.5) - subprocess.run(['xdotool', 'key', 'super+d'], timeout=2) - time.sleep(1.0) - print(f"✅ [ORA/recovery/overlay] Focus VM + Win+D envoyé") - elif PYAUTOGUI_AVAILABLE: - pyautogui.hotkey('super', 'd') - time.sleep(1.0) - except Exception as e: - print(f"⚠️ [ORA/recovery/overlay] Erreur focus VM: {e}") - if PYAUTOGUI_AVAILABLE: - pyautogui.hotkey('super', 'd') - time.sleep(1.0) + # Pas de dialogue connu → fenêtre devant → clic focus + Win+D + print(f"🔧 [ORA/recovery/overlay] Fenêtre devant — clic focus + Win+D") + if PYAUTOGUI_AVAILABLE: + screen_w, screen_h = pyautogui.size() + pyautogui.moveTo(screen_w // 2, screen_h // 2) + time.sleep(0.3) + pyautogui.click() + time.sleep(0.5) + pyautogui.hotkey('super', 'd') + time.sleep(1.0) + print(f"✅ [ORA/recovery/overlay] Clic + Win+D envoyé") # --- Étape 3 : Retry l'action originale --- act_ok = self.act(decision, step_params)