Fix game UI focus loss when hiding focused control to maintain gamepad navigation in Editor

This commit is contained in:
Wojtek Figat
2025-07-15 12:34:02 +02:00
parent 9646dd3fc2
commit c882b547c8

View File

@@ -1176,6 +1176,12 @@ namespace FlaxEditor.Windows
if (!_cursorVisible)
Screen.CursorVisible = true;
}
if (Editor.IsPlayMode && IsDocked && IsSelected && RootWindow.FocusedControl == null)
{
// Game UI cleared focus so regain it to maintain UI navigation just like game window does
FlaxEngine.Scripting.InvokeOnUpdate(Focus);
}
}
/// <inheritdoc />