From c882b547c8709e431ad4f40f731fb6b5fb14b557 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 15 Jul 2025 12:34:02 +0200 Subject: [PATCH] Fix game UI focus loss when hiding focused control to maintain gamepad navigation in Editor --- Source/Editor/Windows/GameWindow.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index acb2deda3..5b243cfed 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -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); + } } ///