diff --git a/src/app_controller.py b/src/app_controller.py index 7b7c5c13..12b44965 100644 --- a/src/app_controller.py +++ b/src/app_controller.py @@ -874,6 +874,7 @@ class AppController: self._trigger_blink: bool = False self._is_blinking: bool = False self._blink_start_time: float = 0.0 + self._pending_focus_response: bool = False self._trigger_script_blink: bool = False self._is_script_blinking: bool = False self._script_blink_start_time: float = 0.0 diff --git a/src/gui_2.py b/src/gui_2.py index 4725be9c..05300852 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -1585,6 +1585,12 @@ def render_main_interface(app: App) -> None: app._process_pending_gui_tasks() app._process_pending_history_adds() if app.controller._process_pending_tool_calls(): app._tool_log_dirty = True + if app._pending_focus_response: + app._pending_focus_response = False + try: + imgui.set_window_focus("Response") # type: ignore[call-arg] + except: + pass #endregion: Process GUI task queue render_track_proposal_modal(app) @@ -5534,13 +5540,10 @@ def render_response_panel(app: App) -> None: """ if app.perf_profiling_enabled: app.perf_monitor.start_component("_render_response_panel") if app._trigger_blink: - app._trigger_blink = False - app._is_blinking = True - app._blink_start_time = time.time() - try: - imgui.set_window_focus("Response") # type: ignore[call-arg] - except: - pass + app._trigger_blink = False + app._is_blinking = True + app._blink_start_time = time.time() + app._pending_focus_response = True is_blinking = False blink_color = imgui.ImVec4(0, 0, 0, 0) if app._is_blinking: