Skip to main content

Auto-focus

When the agent compiles, enters Play mode or changes scene, Buril brings the Unity Editor window to the front by itself.

Why it exists​

Unity works slower when its window is behind another one, and several of the things an agent waits for (a recompile, Play mode, a scene load) only finish once the Editor has focus. Without auto-focus a long session ends up waiting for a human click, and the symptom looks like a slow or hung Editor.

What it does​

BurilFocus.Ensure(...) runs inside the verbs that already wait for the Editor:

Call siteWhen
Editor startupas soon as the bridge loads
wait_for_compilebefore waiting for the compile to finish
enter_play_modebefore entering Play
manage_scenebefore opening or switching scenes

It is idempotent and cheap: if the window is already in front, nothing happens. It restores a minimized window before focusing it, and it checks afterwards that the window really is in front, because the operating system can refuse focus silently.

What it is not​

  • It is window focus at the operating-system level. It does not select objects in the Scene view or the Hierarchy.
  • It is not a tool you call. It runs automatically inside the verbs above.
  • Windows only for now.

Status​

The feature is shipped and used on every drive session. Its speed improvement has not been measured with an A/B comparison yet; what was measured was the symptom it removes (an Editor startup that waited about seven minutes with the window behind). We do not publish a number until we have one.